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 Workflow | |
on: | |
push: | |
tags: | |
- '*.*.*' | |
jobs: | |
release: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Extract tag name | |
id: variables | |
run: echo "version=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT | |
shell: bash | |
- name: Update package.version in tauri.conf.json | |
run: | | |
$json = Get-Content -Path "src-tauri\tauri.conf.json" -Raw | ConvertFrom-Json | |
$json.package.version = "${{ steps.variables.outputs.version }}" | |
$json | ConvertTo-Json -Depth 100 | Set-Content -Path "src-tauri\tauri.conf.json" | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- uses: actions/setup-node@v3 | |
- name: Install dependencies and build | |
env: | |
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} | |
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} | |
run: | | |
npm i | |
npm run tauri build | |
- uses: ncipollo/release-action@v1 | |
with: | |
artifacts: .\src-tauri\target\release\bundle\msi\Launcherg_${{ steps.variables.outputs.version }}_x64_ja-JP.msi.zip | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Update .tauri-updater.json | |
run: | | |
$env:TEMP_SIGNATURE = Get-Content -Path ".\src-tauri\target\release\bundle\msi\Launcherg_${{ steps.variables.outputs.version }}_x64_ja-JP.msi.zip.sig" | |
$data = @{ | |
version = "${{ steps.variables.outputs.version }}" | |
notes = "See the assets to download this version and install." | |
pub_date = (Get-Date -Format s) + "Z" | |
signature = $env:TEMP_SIGNATURE | |
url = "https://github.com/ryoha000/launcherg/releases/download/${{ steps.variables.outputs.version }}/Launcherg_${{ steps.variables.outputs.version }}_x64_ja-JP.msi.zip" | |
} | |
$data | ConvertTo-Json | Set-Content -Path ".tauri-updater.json" | |
- name: format files | |
run: npx -y prettier .\src-tauri\tauri.conf.json .\.tauri-updater.json --write | |
- name: Push updated files to main | |
run: | | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git add src-tauri/tauri.conf.json | |
git add .tauri-updater.json | |
git commit -m "Update for release ${{ steps.variables.outputs.version }}" | |
git push origin main | |
shell: bash |