Skip to content

Workflow file for this run

name: Release Workflow
on:
push:
tags:
- '*.*.*'
jobs:
release:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Extract tag name
run: echo "version=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT
- 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/setup-node@v3
- name: Install Rust stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- 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
- name: Create Release
id: create-release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ steps.variables.outputs.version }}
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: .\src-tauri\target\release\bundle\msi\Launcherg_${{ steps.variables.outputs.version }}_x64_ja-JP.msi.zip
asset_name: Launcherg_${{ steps.variables.outputs.version }}_x64_ja-JP.msi.zip
asset_content_type: application/zip
- name: Update .tauri-updater.json
run: |
$data = @{
version = "${{ steps.variables.outputs.version }}"
notes = "See the assets to download this version and install."
pub_date = (Get-Date -Format s) + "Z"
signature = ".\src-tauri\target\release\bundle\msi\Launcherg_${{ steps.variables.outputs.version }}_x64_ja-JP.msi.zip"
url = ${{ steps.upload-release-asset.outputs.browser_download_url }}
}
$data | ConvertTo-Json | Set-Content -Path ".tauri-updater.json"
- 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)"
npx -y prettier .\src-tauri\tauri.conf.json .\.tauri-updater.json --write
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