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: "marvinpinto/action-automatic-releases@latest" | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: ${{ github.ref }} | |
prerelease: true | |
title: "Release ${{ steps.variables.outputs.version }}" | |
files: | | |
.\src-tauri\target\release\bundle\msi\Launcherg_${{ steps.variables.outputs.version }}_x64_ja-JP.msi.zip | |
- 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 = ${{ steps.upload-release-asset.outputs.browser_download_url }} | |
} | |
$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 user.name "$(git --no-pager log --format=format:'%an' -n 1)" | |
git config user.name "$(git --no-pager log --format=format:'%an' -n 1)" | |
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 |