Merge pull request #32 from workfunction/main #15
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 | |
on: | |
push: | |
tags: [ v\d+\.\d+\.\d+ ] | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: write | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- 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=$(git tag -l --format='%(contents:subject)' ${{ steps.get_version.outputs.version }})" >> $GITHUB_OUTPUT | |
- name: Change version | |
run: | | |
OLD_VERSION=$(grep '"version":' src/info.json | awk -F\" '{print $4}') | |
sed -i "s/$OLD_VERSION/${{ steps.get_version.outputs.version-without-v }}/" src/info.json | |
- name: Package plugin | |
run: mkdir release && zip -j -r release/openai-polisher-${{ steps.get_version.outputs.version-without-v }}.bobplugin ./src/* | |
- run: git checkout -- src/ | |
- name: Update appcast.json | |
run: | | |
python3 scripts/update_release.py ${{ steps.get_version.outputs.version-without-v }} '${{ steps.tag.outputs.message }}' | |
- name: Commit files | |
run: | | |
git config --global user.name 'Bryan Lee' | |
git config --global user.email '38807139+liby@users.noreply.github.com' | |
git commit -am 'chore: update appcast.json and info.json' | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload binaries to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
release_name: ${{ steps.get_version.outputs.version }} | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: release/openai-polisher-${{ steps.get_version.outputs.version-without-v }}.bobplugin | |
asset_name: openai-polisher-${{ steps.get_version.outputs.version-without-v }}.bobplugin | |
tag: ${{ github.ref }} | |
overwrite: true | |
body: ${{ steps.tag.outputs.message }} |