mirror of
https://github.com/SableClient/Sable.git
synced 2026-11-27 04:16:25 -08:00
Bumps the github-actions group with 15 updates in the / directory: | Package | From | To | | --- | --- | --- | | [cloudflare/wrangler-action](https://github.com/cloudflare/wrangler-action) | `4.0.0` | `4.1.3` | | [dflook/tofu-plan](https://github.com/dflook/tofu-plan) | `3.0.0` | `3.1.2` | | [github/codeql-action/init](https://github.com/github/codeql-action) | `4.37.9` | `4.39.1` | | [github/codeql-action/analyze](https://github.com/github/codeql-action) | `4.37.9` | `4.39.1` | | [docker/login-action](https://github.com/docker/login-action) | `4.6.0` | `4.7.0` | | [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) | `4.3.0` | `4.4.0` | | [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) | `4.3.0` | `4.4.1` | | [docker/build-push-action](https://github.com/docker/build-push-action) | `7.3.0` | `7.4.0` | | [actions/upload-artifact](https://github.com/actions/upload-artifact) | `7.0.1` | `7.0.2` | | [actions/create-github-app-token](https://github.com/actions/create-github-app-token) | `3.2.0` | `3.3.0` | | [DeterminateSystems/determinate-nix-action](https://github.com/determinatesystems/determinate-nix-action) | `3.22.2` | `3.24.0` | | [Swatinem/rust-cache](https://github.com/swatinem/rust-cache) | `2.9.2` | `2.9.3` | | [gradle/actions/setup-gradle](https://github.com/gradle/actions) | `6.3.0` | `6.4.0` | | [jdx/mise-action](https://github.com/jdx/mise-action) | `4.3.0` | `5.2.2` | | [actions/download-artifact](https://github.com/actions/download-artifact) | `8.0.1` | `8.0.2` | Updates `cloudflare/wrangler-action` from 4.0.0 to 4.1.3 - [Release notes](https://github.com/cloudflare/wrangler-action/releases) - [Changelog](https://github.com/cloudflare/wrangler-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/cloudflare/wrangler-action/compare/ebbaa1584979971c8614a24965b4405ff95890e0...953926a2e2182532811c01a25e53647d93bf07c0) Updates `dflook/tofu-plan` from 3.0.0 to 3.1.2 - [Release notes](https://github.com/dflook/tofu-plan/releases) - [Commits](https://github.com/dflook/tofu-plan/compare/cdb4f4d604c9fa695e457744dd1f802853397ce7...53b5b01b6eef56cd678401dbe92a0f6ca6b863ff) Updates `github/codeql-action/init` from 4.37.9 to 4.39.1 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/cdf488f595d80d6e07e03d4674febd5ab45fa938...9b3254085494b55a0f7c4c2b3d2d52cc712ce370) Updates `github/codeql-action/analyze` from 4.37.9 to 4.39.1 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/cdf488f595d80d6e07e03d4674febd5ab45fa938...9b3254085494b55a0f7c4c2b3d2d52cc712ce370) Updates `docker/login-action` from 4.6.0 to 4.7.0 - [Release notes](https://github.com/docker/login-action/releases) - [Commits](https://github.com/docker/login-action/compare/dbcb813823bdd20940b903addbd779551569679f...81c6f93d4bc991e510b342a00b419b3bb4efc5c6) Updates `docker/setup-qemu-action` from 4.3.0 to 4.4.0 - [Release notes](https://github.com/docker/setup-qemu-action/releases) - [Commits](https://github.com/docker/setup-qemu-action/compare/1f40c72289eff860ee54a304f1438e3cff362e0a...99012661954931238ded8c8b007157a8430204e1) Updates `docker/setup-buildx-action` from 4.3.0 to 4.4.1 - [Release notes](https://github.com/docker/setup-buildx-action/releases) - [Commits](https://github.com/docker/setup-buildx-action/compare/37fe631027851001ddb9b187196cc803df7f5f0e...f87e5991a6d7451dcb8d9637bfbc97413f497069) Updates `docker/build-push-action` from 7.3.0 to 7.4.0 - [Release notes](https://github.com/docker/build-push-action/releases) - [Commits](https://github.com/docker/build-push-action/compare/53b7df96c91f9c12dcc8a07bcb9ccacbed38856a...c3c9e263c25d99ce0380d002d59b67737d91b0dc) Updates `actions/upload-artifact` from 7.0.1 to 7.0.2 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/043fb46d1a93c77aae656e7c1c64a875d1fc6a0a...cf430e030ddbb5b0abf93d22962f4752f3646cd9) Updates `actions/create-github-app-token` from 3.2.0 to 3.3.0 - [Release notes](https://github.com/actions/create-github-app-token/releases) - [Changelog](https://github.com/actions/create-github-app-token/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/create-github-app-token/compare/bcd2ba49218906704ab6c1aa796996da409d3eb1...64ab729a6294000f5aa4a4bc0b73d1f32bc45510) Updates `DeterminateSystems/determinate-nix-action` from 3.22.2 to 3.24.0 - [Release notes](https://github.com/determinatesystems/determinate-nix-action/releases) - [Commits](https://github.com/determinatesystems/determinate-nix-action/compare/527f17dd63d2d60d3e5552934bc84b9a33a14d11...f296148a827001a9a82d3685b53210c06e5d3b67) Updates `Swatinem/rust-cache` from 2.9.2 to 2.9.3 - [Release notes](https://github.com/swatinem/rust-cache/releases) - [Changelog](https://github.com/Swatinem/rust-cache/blob/master/CHANGELOG.md) - [Commits](https://github.com/swatinem/rust-cache/compare/6323deb102c322ba6fcbdcafc7e3dddab59af2b6...d1527c8f67ef9af357290475d4af4b0fab8f12e0) Updates `gradle/actions/setup-gradle` from 6.3.0 to 6.4.0 - [Release notes](https://github.com/gradle/actions/releases) - [Commits](https://github.com/gradle/actions/compare/9c971963bec38e04b3d30dcc455b5382be2fdbfb...3f5f9adaf7d9fecd50b5935e54106014257a94e6) Updates `jdx/mise-action` from 4.3.0 to 5.2.2 - [Release notes](https://github.com/jdx/mise-action/releases) - [Changelog](https://github.com/jdx/mise-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/jdx/mise-action/compare/c2a87611a18de5b3828c5652fe268e992400cb5c...8418fedb1110381a0d3ba51a7a415d7c1b884550) Updates `actions/download-artifact` from 8.0.1 to 8.0.2 - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c...9000827ccba6bdab643e8b6fd33ac0654aef8333) --- updated-dependencies: - dependency-name: cloudflare/wrangler-action dependency-version: 4.1.3 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions - dependency-name: dflook/tofu-plan dependency-version: 3.1.2 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions - dependency-name: github/codeql-action/init dependency-version: 4.39.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions - dependency-name: github/codeql-action/analyze dependency-version: 4.39.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions - dependency-name: docker/login-action dependency-version: 4.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions - dependency-name: docker/setup-qemu-action dependency-version: 4.4.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions - dependency-name: docker/setup-buildx-action dependency-version: 4.4.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions - dependency-name: docker/build-push-action dependency-version: 7.4.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions - dependency-name: actions/upload-artifact dependency-version: 7.0.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions - dependency-name: actions/create-github-app-token dependency-version: 3.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions - dependency-name: DeterminateSystems/determinate-nix-action dependency-version: 3.24.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions - dependency-name: Swatinem/rust-cache dependency-version: 2.9.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions - dependency-name: gradle/actions/setup-gradle dependency-version: 6.4.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions - dependency-name: jdx/mise-action dependency-version: 5.2.2 dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: actions/download-artifact dependency-version: 8.0.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions ... Signed-off-by: dependabot[bot] <[email protected]>
246 lines
8.2 KiB
YAML
246 lines
8.2 KiB
YAML
name: PR build
|
|
|
|
# On-demand PR build (APK / unsigned IPA); dispatched by /build or run manually.
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
pr_number:
|
|
description: Pull request number to build
|
|
required: true
|
|
type: number
|
|
platform:
|
|
description: Platform to build
|
|
required: true
|
|
default: both
|
|
type: choice
|
|
options:
|
|
- android
|
|
- ios
|
|
- both
|
|
|
|
permissions:
|
|
contents: read
|
|
issues: write
|
|
pull-requests: write
|
|
|
|
concurrency:
|
|
group: pr-build-${{ inputs.pr_number }}
|
|
cancel-in-progress: false
|
|
|
|
env:
|
|
CARGO_INCREMENTAL: 0
|
|
CARGO_TERM_COLOR: always
|
|
SABLE_BUILD_FLAVOR: dev
|
|
VITE_APP_VERSION: 0.0.0-pr.${{ inputs.pr_number }}
|
|
|
|
jobs:
|
|
resolve:
|
|
name: Resolve PR #${{ inputs.pr_number }}
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 5
|
|
outputs:
|
|
head_sha: ${{ steps.pr.outputs.head_sha }}
|
|
title: ${{ steps.pr.outputs.title }}
|
|
steps:
|
|
- name: Fetch pull request
|
|
id: pr
|
|
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
|
with:
|
|
script: |
|
|
const { owner, repo } = context.repo
|
|
const { data: pull } = await github.rest.pulls.get({
|
|
owner,
|
|
repo,
|
|
pull_number: ${{ inputs.pr_number }},
|
|
})
|
|
core.setOutput('head_sha', pull.head.sha)
|
|
core.setOutput('title', pull.title)
|
|
|
|
build-android:
|
|
name: Build Android (PR #${{ inputs.pr_number }})
|
|
needs: resolve
|
|
if: ${{ inputs.platform != 'ios' }}
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 45
|
|
env:
|
|
MISE_ENV: tauri
|
|
RUST_TARGETS: aarch64-linux-android armv7-linux-androideabi
|
|
ANDROID_KEY_BASE64: ${{ secrets.ANDROID_KEY_BASE64 }}
|
|
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }}
|
|
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }}
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
ref: refs/pull/${{ inputs.pr_number }}/merge
|
|
persist-credentials: false
|
|
|
|
- name: Setup app
|
|
uses: ./.github/actions/setup
|
|
with:
|
|
tauri: 'true'
|
|
|
|
- name: Setup Android SDK + NDK
|
|
shell: bash
|
|
run: mise run tauri:setup:android
|
|
|
|
- name: Add Rust targets
|
|
shell: bash
|
|
run: rustup target add $RUST_TARGETS
|
|
|
|
- name: Cache Rust build
|
|
uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
|
|
with:
|
|
workspaces: src-tauri
|
|
|
|
- name: Setup Gradle
|
|
uses: gradle/actions/setup-gradle@3f5f9adaf7d9fecd50b5935e54106014257a94e6 # v6.4.0
|
|
|
|
- name: Resolve NDK
|
|
shell: bash
|
|
run: echo "NDK_HOME=$ANDROID_HOME/ndk/$ANDROID_NDK_VERSION" >> "$GITHUB_ENV"
|
|
|
|
- name: Setup Android signing
|
|
if: ${{ env.ANDROID_KEY_BASE64 != '' }}
|
|
shell: bash
|
|
run: |
|
|
cd src-tauri/gen/android
|
|
echo "keyAlias=$ANDROID_KEY_ALIAS" > keystore.properties
|
|
echo "password=$ANDROID_KEY_PASSWORD" >> keystore.properties
|
|
base64 -d <<< "$ANDROID_KEY_BASE64" > "$RUNNER_TEMP/keystore.jks"
|
|
echo "storeFile=$RUNNER_TEMP/keystore.jks" >> keystore.properties
|
|
|
|
- name: Build Android APK
|
|
shell: bash
|
|
run: |
|
|
export SABLE_LAUNCHER_ICON=dev
|
|
if [ -n "${ANDROID_KEY_BASE64:-}" ]; then
|
|
pnpm tauri android build --config src-tauri/tauri.pr.conf.json --apk --target aarch64 armv7
|
|
else
|
|
# No keystore secret available: build a debug APK (signed with the
|
|
# debug keystore) so members can still sideload the build.
|
|
pnpm tauri android build --config src-tauri/tauri.pr.conf.json --debug --apk --target aarch64 armv7
|
|
fi
|
|
OUT='src-tauri/gen/android/app/build/outputs'
|
|
APK=$(find "$OUT/apk" -name '*.apk' -type f | head -1)
|
|
[ -n "$APK" ] || { echo "APK not found"; exit 1; }
|
|
mv "$APK" "$OUT/Sable-pr${{ inputs.pr_number }}-android.apk"
|
|
|
|
- name: Upload APK
|
|
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
with:
|
|
name: sable-pr${{ inputs.pr_number }}-android
|
|
path: src-tauri/gen/android/app/build/outputs/Sable-pr${{ inputs.pr_number }}-android.apk
|
|
if-no-files-found: error
|
|
retention-days: 7
|
|
|
|
build-ios:
|
|
name: Build iOS (PR #${{ inputs.pr_number }})
|
|
needs: resolve
|
|
if: ${{ inputs.platform != 'android' }}
|
|
runs-on: macos-latest
|
|
timeout-minutes: 60
|
|
env:
|
|
RUST_TARGETS: aarch64-apple-ios
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
ref: refs/pull/${{ inputs.pr_number }}/merge
|
|
persist-credentials: false
|
|
|
|
- name: Setup app
|
|
uses: ./.github/actions/setup
|
|
with:
|
|
tauri: 'true'
|
|
|
|
- name: Add Rust targets
|
|
shell: bash
|
|
run: rustup target add $RUST_TARGETS
|
|
|
|
- name: Cache Rust build
|
|
uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3
|
|
with:
|
|
workspaces: src-tauri
|
|
|
|
- name: Set up iOS
|
|
shell: bash
|
|
run: mise -y run tauri:setup:ios
|
|
|
|
- name: Download iOS frameworks
|
|
shell: bash
|
|
run: pnpm ios:frameworks
|
|
|
|
- name: Symlink icons to the ios folder
|
|
shell: bash
|
|
run: mise run icons:symlink --write --force
|
|
|
|
- name: Build unsigned IPA
|
|
shell: bash
|
|
run: |
|
|
export SABLE_LAUNCHER_ICON=dev
|
|
pnpm tauri ios build --config src-tauri/tauri.pr.conf.json --no-sign --ci
|
|
IPA=$(find src-tauri/gen/apple/build -name '*.ipa' -type f | head -1)
|
|
[ -n "$IPA" ] || { echo "IPA not found"; exit 1; }
|
|
mv "$IPA" "$(dirname "$IPA")/Sable-pr${{ inputs.pr_number }}-ios.ipa"
|
|
|
|
- name: Upload IPA
|
|
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
with:
|
|
name: sable-pr${{ inputs.pr_number }}-ios
|
|
path: src-tauri/gen/apple/build/**/Sable-pr${{ inputs.pr_number }}-ios.ipa
|
|
if-no-files-found: error
|
|
retention-days: 7
|
|
|
|
comment:
|
|
name: Post build result comment
|
|
needs: [resolve, build-android, build-ios]
|
|
if: ${{ always() && !cancelled() && needs.resolve.result == 'success' }}
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 5
|
|
env:
|
|
HEAD_SHA: ${{ needs.resolve.outputs.head_sha }}
|
|
PR_TITLE: ${{ needs.resolve.outputs.title }}
|
|
steps:
|
|
- name: Update PR comment
|
|
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
|
|
with:
|
|
script: |
|
|
const { owner, repo } = context.repo
|
|
const issue_number = ${{ inputs.pr_number }}
|
|
const marker = '<!-- pr-build -->'
|
|
const shortSha = process.env.HEAD_SHA.slice(0, 7)
|
|
const runUrl = `${context.serverUrl}/${owner}/${repo}/actions/runs/${context.runId}`
|
|
const status = (result) =>
|
|
result === 'success' ? ':white_check_mark: success'
|
|
: result === 'failure' ? ':x: failure'
|
|
: result === 'cancelled' ? ':stop_sign: cancelled'
|
|
: ':fast_forward: skipped'
|
|
|
|
const body = [
|
|
marker,
|
|
'## PR build',
|
|
'',
|
|
'| Platform | Status |',
|
|
'| --- | --- |',
|
|
`| Android | ${status('${{ needs.build-android.result }}')} |`,
|
|
`| iOS | ${status('${{ needs.build-ios.result }}')} |`,
|
|
'',
|
|
`- [Download artifacts](${runUrl}#artifacts) — expire after 7 days.`,
|
|
`- Commit \`${shortSha}\`: ${process.env.PR_TITLE}`,
|
|
].join('\n')
|
|
|
|
const { data: comments } = await github.rest.issues.listComments({ owner, repo, issue_number })
|
|
const previous = comments.find((comment) => comment.body?.includes(marker))
|
|
|
|
if (previous) {
|
|
await github.rest.issues.updateComment({
|
|
owner,
|
|
repo,
|
|
comment_id: previous.id,
|
|
body,
|
|
})
|
|
} else {
|
|
await github.rest.issues.createComment({ owner, repo, issue_number, body })
|
|
}
|