Release v1.12.0 #107
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Release' | |
run-name: "${{ github.event_name == 'release' && format('Release {0}', github.ref_name) || format('Snapshot {0}', github.sha) }}" | |
on: | |
release: | |
types: [ published ] | |
workflow_dispatch: | |
env: | |
TAURI_BUILD_FLAGS: "${{ github.event_name == 'release' && ' ' || '-d' }}" | |
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }} | |
SENTRY_ORG: webosbrew | |
SENTRY_PROJECT: dev-manager-desktop-ui | |
SENTRY_ENVIRONMENT: "${{ github.event_name == 'release' && 'release' || 'development' }}" | |
jobs: | |
sentry-create-release: | |
name: Create Sentry Release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20.x | |
- name: Extract Version | |
id: pkg-version | |
uses: Saionaro/[email protected] | |
- name: Generate Sentry Release Name | |
id: release-info | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
if (process.env.SENTRY_ENVIRONMENT !== 'release') { | |
return "${{ steps.pkg-version.outputs.version }}-" + context.sha.substring(0, 7); | |
} else { | |
return "${{ steps.pkg-version.outputs.version }}"; | |
} | |
result-encoding: string | |
- uses: getsentry/action-release@v1 | |
name: Create Sentry Release | |
with: | |
version: ${{ steps.release-info.outputs.result }} | |
ignore_missing: true | |
ignore_empty: true | |
finalize: false | |
outputs: | |
release: ${{ steps.release-info.outputs.result }} | |
build: | |
name: Build Package | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ windows-latest, ubuntu-20.04, macos-latest ] | |
runs-on: ${{ matrix.os }} | |
needs: sentry-create-release | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cache Node Modules | |
uses: actions/cache@v3 | |
with: | |
# npm cache files are stored in `~/.npm` on Linux/macOS | |
path: ~/.npm | |
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node_modules | |
- name: Install Required Packages (Linux) | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 20.x | |
- name: Write Version | |
uses: actions/github-script@v6 | |
with: | |
script: | | |
const release = "${{ needs.sentry-create-release.outputs.release }}".trim(); | |
if (!release) { | |
core.setFailed('Sentry release was not found'); | |
return; | |
} | |
const fs = require('fs'); | |
fs.writeFileSync('src/release.json', JSON.stringify({ | |
version: release | |
})); | |
- name: Install NPM Dependencies | |
run: npm ci | |
- name: Build the app (Windows) | |
if: runner.os == 'Windows' | |
run: | | |
rustup target add i686-pc-windows-msvc | |
npm run build -- --features=vendored-openssl --target x86_64-pc-windows-msvc ${{ env.TAURI_BUILD_FLAGS }} | |
npm run build -- --features=vendored-openssl --target i686-pc-windows-msvc ${{ env.TAURI_BUILD_FLAGS }} | |
- name: Build the app (Linux) | |
if: runner.os == 'Linux' | |
run: npm run build -- --features=vendored-openssl ${{ env.TAURI_BUILD_FLAGS }} | |
- name: Build the app (macOS) | |
if: runner.os == 'macOS' | |
run: | | |
# Blocked by https://github.com/webosbrew/dev-manager-desktop/issues/116 | |
# rustup target add aarch64-apple-darwin | |
# npm run build -- --features=vendored-openssl --target universal-apple-darwin ${{ env.TAURI_BUILD_FLAGS }} | |
npm run build -- --features=vendored-openssl ${{ env.TAURI_BUILD_FLAGS }} | |
- name: Upload Source Maps | |
run: npx --yes @sentry/cli sourcemaps upload -r ${{ needs.sentry-create-release.outputs.release }} dist | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v3 | |
if: github.event_name != 'release' | |
with: | |
name: ${{ runner.os }}-snapshot | |
path: | | |
src-tauri/target/**/bundle/deb/*.deb | |
src-tauri/target/**/bundle/appimage/*.AppImage | |
src-tauri/target/**/bundle/msi/*.msi | |
src-tauri/target/**/bundle/dmg/*.dmg | |
- name: Create Release | |
uses: ncipollo/release-action@v1 | |
if: github.event_name == 'release' | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
name: Dev Manager ${{ github.ref_name }} | |
allowUpdates: true | |
omitNameDuringUpdate: true | |
omitBodyDuringUpdate: true | |
omitPrereleaseDuringUpdate: true | |
artifacts: "src-tauri/target/**/bundle/deb/*.deb,\ | |
src-tauri/target/**/bundle/appimage/*.AppImage,\ | |
src-tauri/target/**/bundle/msi/*.msi,\ | |
src-tauri/target/**/bundle/dmg/*.dmg" | |
sentry-finalize-release: | |
name: Finalize Sentry Release | |
runs-on: ubuntu-latest | |
needs: [ sentry-create-release, build ] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: getsentry/action-release@v1 | |
with: | |
version: ${{ needs.sentry-create-release.outputs.release }} | |
ignore_missing: true | |
ignore_empty: true | |
finalize: false |