Skip to content

Commit

Permalink
chore: tweak publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Bin-Huang committed Apr 13, 2023
1 parent 4cab56f commit 0033a70
Showing 1 changed file with 37 additions and 8 deletions.
45 changes: 37 additions & 8 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,43 @@
name: 'publish'
name: Release

on:
push:
tags: [ v\d+\.\d+\.\d+ ]

jobs:
publish-tauri:
create-release:
permissions:
contents: write
runs-on: ubuntu-20.04
outputs:
release_id: ${{ steps.create-release.outputs.id }}
release_upload_url: ${{ steps.create-release.outputs.upload_url }}

steps:
- uses: actions/checkout@v3

- name: Get version
id: get_version
uses: battila7/get-version-action@v2

- name: Get tag message
id: tag
run: |
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
echo "message<<EOF" >> $GITHUB_OUTPUT
echo "$(git tag -l --format='%(contents)' ${{ steps.get_version.outputs.version }})" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Create Release
id: create-release
uses: ncipollo/release-action@v1
with:
draft: true
name: ${{ steps.get_version.outputs.version }}
tag: ${{ steps.get_version.outputs.version }}
body: "${{ steps.tag.outputs.message }}"

build-tauri:
needs: create-release
permissions:
contents: write
strategy:
Expand Down Expand Up @@ -58,7 +91,7 @@ jobs:
- name: Build Tauri App
uses: tauri-apps/tauri-action@dev
env:
GITHUB_TOKEN: ${{ secrets.GITHUBTOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ENABLE_CODE_SIGNING: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
Expand All @@ -68,8 +101,4 @@ jobs:
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
with:
tagName: Chatbox-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version
releaseName: 'Chatbox v__VERSION__'
releaseBody: 'See the assets to download this version and install.'
releaseDraft: true
prerelease: false
releaseId: ${{ needs.create-release.outputs.release_id }}

0 comments on commit 0033a70

Please sign in to comment.