mirror of
https://github.com/pvrzz/atmosphere.git
synced 2026-11-29 05:22:26 +00:00
Signed automatic updates from GitHub Releases
- Atmosphere checks the repo's latest release and offers new versions with their notes - Updates are signed; installed copies refuse anything not signed with the project key - Installer, macOS and AppImage builds update themselves; portable and deb/rpm link to the download - Release workflow builds, signs and publishes every platform with latest.json on a version tag - Check-for-updates row and automatic check setting in Settings - Release guide in docs/releasing.md
This commit is contained in:
@@ -0,0 +1,92 @@
|
||||
# atmosphere · release.yml · On a version tag, builds and signs every platform and publishes a GitHub Release with latest.json for in-app updates.
|
||||
name: release
|
||||
|
||||
on:
|
||||
push:
|
||||
tags: ["v*"]
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
check:
|
||||
runs-on: ubuntu-22.04
|
||||
outputs:
|
||||
version: ${{ steps.v.outputs.version }}
|
||||
notes: ${{ steps.v.outputs.notes }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- id: v
|
||||
name: Tag matches the app version
|
||||
run: |
|
||||
version=$(jq -r .version tauri.conf.json)
|
||||
cargo_version=$(grep -m1 '^version' Cargo.toml | cut -d'"' -f2)
|
||||
tag="${GITHUB_REF_NAME#v}"
|
||||
if [ "$version" != "$tag" ] || [ "$cargo_version" != "$tag" ]; then
|
||||
echo "::error::Tag v$tag doesn't match tauri.conf.json ($version) and Cargo.toml ($cargo_version)."
|
||||
exit 1
|
||||
fi
|
||||
echo "version=$version" >> "$GITHUB_OUTPUT"
|
||||
{
|
||||
echo "notes<<ATMO_NOTES_END"
|
||||
sed '/^<!--/d' RELEASE_NOTES.md
|
||||
echo "ATMO_NOTES_END"
|
||||
} >> "$GITHUB_OUTPUT"
|
||||
|
||||
publish:
|
||||
needs: check
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- os: windows-latest
|
||||
name: windows-x64
|
||||
- os: macos-latest
|
||||
name: macos-arm64
|
||||
- os: macos-13
|
||||
name: macos-x64
|
||||
- os: ubuntu-22.04
|
||||
name: linux-x64
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Linux system libraries
|
||||
if: runner.os == 'Linux'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev patchelf
|
||||
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
|
||||
- name: Tests
|
||||
run: cargo test --locked
|
||||
|
||||
- name: Install Tauri CLI
|
||||
run: cargo install tauri-cli --version "^2" --locked
|
||||
|
||||
- name: Build, sign and publish
|
||||
uses: tauri-apps/tauri-action@v0
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
|
||||
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ""
|
||||
with:
|
||||
tauriScript: cargo tauri
|
||||
tagName: v__VERSION__
|
||||
releaseName: Atmosphere __VERSION__
|
||||
releaseBody: ${{ needs.check.outputs.notes }}
|
||||
releaseDraft: false
|
||||
prerelease: false
|
||||
includeUpdaterJson: true
|
||||
|
||||
- name: Portable executable
|
||||
if: runner.os == 'Windows'
|
||||
shell: bash
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
cp target/release/atmosphere.exe "Atmosphere_${{ needs.check.outputs.version }}_x64-portable.exe"
|
||||
gh release upload "$GITHUB_REF_NAME" "Atmosphere_${{ needs.check.outputs.version }}_x64-portable.exe" --clobber
|
||||
Reference in New Issue
Block a user