mirror of
https://github.com/xtool-org/xtool.git
synced 2026-11-17 05:53:18 +01:00
## What does this PR do? When we publish 2.0.0-beta.1, mark it as a pre-release on GH Releases ## AI tool usage How much of the code in this PR was AI-assisted? (check one) - [ ] **0** - No AI was used to write code - [x] **1** - I was assisted by AI in writing code. I reviewed the finished result. - [ ] **2** - I set the AI going and left it to it; nobody has read the result - no review, or AI review only <!-- If an AI agent is filling this in: declare the level honestly, and open as a draft if it is #2. Do not lower the declared level to get the PR reviewed. --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Release Process** * Releases are now created as drafts for review before publication. * Releases with hyphenated tags are marked as prereleases and are not designated as the latest release. * Releases with tags that do not contain a hyphen are not marked as prereleases and do not receive a latest-release designation. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
115 lines
3.4 KiB
YAML
115 lines
3.4 KiB
YAML
on:
|
|
push:
|
|
tags:
|
|
- "*"
|
|
|
|
env:
|
|
XTL_CI: "1"
|
|
|
|
jobs:
|
|
build-linux:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
host:
|
|
- runner: ubuntu-24.04
|
|
arch: x86_64
|
|
- runner: ubuntu-24.04-arm
|
|
arch: aarch64
|
|
runs-on: ${{ matrix.host.runner }}
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
- name: Build
|
|
run: |
|
|
docker compose run --build \
|
|
-e XTOOL_VERSION=${{ github.ref_name }} \
|
|
-e XTL_CI=1 \
|
|
--rm xtool Linux/build.sh
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: xtool-${{ matrix.host.arch }}
|
|
path: |
|
|
Linux/packages/xtool-${{ matrix.host.arch }}.AppImage
|
|
Linux/packages/xtool-${{ matrix.host.arch }}.AppImage.zsync
|
|
build-mac:
|
|
runs-on: xcode-27
|
|
permissions:
|
|
contents: write
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v6
|
|
- uses: ./.github/actions/configure-xcode
|
|
- name: Setup Ruby
|
|
uses: ruby/setup-ruby@v1
|
|
with:
|
|
working-directory: macOS
|
|
bundler-cache: true
|
|
- name: Build
|
|
env:
|
|
APP_STORE_CONNECT_API_KEY_KEY_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_KEY_ID }}
|
|
APP_STORE_CONNECT_API_KEY_ISSUER_ID: ${{ secrets.APP_STORE_CONNECT_API_KEY_ISSUER_ID }}
|
|
APP_STORE_CONNECT_API_KEY_KEY: ${{ secrets.APP_STORE_CONNECT_API_KEY_KEY }}
|
|
IDENTITY_P12: ${{ secrets.IDENTITY_P12 }}
|
|
DEVELOPMENT_TEAM: ${{ secrets.DEVELOPMENT_TEAM }}
|
|
XTOOL_VERSION: ${{ github.ref_name }}
|
|
run: |
|
|
brew install -y xcodegen
|
|
cd macOS
|
|
bundle exec fastlane package
|
|
- name: Upload artifacts
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: xtool-mac
|
|
path: |
|
|
macOS/Build/Output/xtool.app.zip
|
|
macOS/Build/Output/xtool.app.dSYM.zip
|
|
release:
|
|
needs: [build-linux, build-mac]
|
|
runs-on: ubuntu-24.04
|
|
permissions:
|
|
contents: write
|
|
env:
|
|
GH_TOKEN: ${{ github.token }}
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- name: Download artifact
|
|
uses: actions/download-artifact@v8
|
|
with:
|
|
pattern: xtool-*
|
|
path: output
|
|
- name: Create and publish release
|
|
run: |
|
|
TAG="${{ github.ref_name }}"
|
|
FLAGS=(--draft)
|
|
# e.g. 2.0.0-beta.1
|
|
if [[ "$TAG" == *-* ]]; then
|
|
FLAGS+=(--prerelease --latest=false)
|
|
fi
|
|
gh release create "$TAG" "${FLAGS[@]}" --title "v$TAG"
|
|
gh release upload "$TAG" output/**/*.{AppImage,AppImage.zsync,app.zip,app.dSYM.zip}
|
|
docker:
|
|
uses: docker/github-builder/.github/workflows/build.yml@v1
|
|
permissions:
|
|
contents: read # to fetch the repository content
|
|
id-token: write # for signing attestations and cache entries with GitHub OIDC
|
|
packages: write # to push built images to GitHub Container Registry
|
|
with:
|
|
build-args: |
|
|
XTL_CI=1
|
|
output: image
|
|
push: true
|
|
platforms: linux/amd64,linux/arm64
|
|
meta-images: |
|
|
ghcr.io/xtool-org/xtool
|
|
meta-tags: |
|
|
type=semver,pattern={{version}}
|
|
secrets:
|
|
registry-auths: |
|
|
- registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|