fix: update release macos actions

This commit is contained in:
tiny-craft 2023-08-08 16:33:19 +08:00
parent 2863d7cab7
commit 1abef5de36
1 changed files with 19 additions and 15 deletions

View File

@ -1,8 +1,9 @@
name: Release macOS App name: Release macOS App
on: on:
release: push:
types: [published] tags:
- 'v*.*.*'
jobs: jobs:
release: release:
@ -60,8 +61,8 @@ jobs:
shell: bash shell: bash
run: | run: |
npm install -g npm npm install -g npm
npm install -g json jq '.info.productVersion = "${{ steps.normalise_version.outputs.version }}"' wails.json > tmp.json
json -I -f wails.json -e "this.info.productVersion='${{ steps.normalise_version.outputs.version }}'" mv tmp.json wails.json
cd frontend && npm install cd frontend && npm install
- name: Build wails app for macOS - name: Build wails app for macOS
@ -79,21 +80,24 @@ jobs:
shell: bash shell: bash
run: cd build/bin && zip -r TinyRDM-${{ steps.normalise_platform.outputs.tag }}.zip TinyRDM.app run: cd build/bin && zip -r TinyRDM-${{ steps.normalise_platform.outputs.tag }}.zip TinyRDM.app
- name: Get latest release from API - name: Create Release
id: get_upload_url id: create_release
shell: bash uses: actions/create-release@v1.1.4
run: | env:
curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/${GITHUB_REPOSITORY}/releases" > /tmp/releases.json GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
url=$(jq -r '.[0].upload_url' /tmp/releases.json) with:
echo "url=$url" >> "$GITHUB_OUTPUT" tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: true
prerelease: false
- name: Upload artifact - name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1.0.2 uses: actions/upload-release-asset@v1.0.2
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ARTIFACT_NAME: TinyRDM_${{ steps.normalise_version.outputs.version }}_${{ steps.normalise_platform.outputs.tag }}
with: with:
upload_url: ${{ steps.get_upload_url.outputs.url }} upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./build/bin/TinyRDM-${{ steps.normalise_platform.outputs.tag }}.zip asset_path: ./build/bin/TinyRDM-${{ steps.normalise_platform.outputs.tag }}.zip
asset_name: ${{ env.ARTIFACT_NAME }}.zip asset_name: TinyRDM_{{ steps.normalise_version.outputs.version }}_${{ steps.normalise_platform.outputs.tag }}.zip
asset_content_type: application/zip asset_content_type: application/zip