opengoal-launcher/.github/workflows/kickoff-release.yaml

56 lines
1.7 KiB
YAML
Raw Normal View History

name: Kick off Release
on:
workflow_dispatch:
inputs:
bump:
description: "Semver Bump Type"
required: true
default: "patch"
type: choice
options:
- "patch"
- "minor"
- "major"
jobs:
kick-off-release:
if: github.repository == 'open-goal/launcher'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.BOT_PAT }}
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16
cache: yarn
- name: Install Rust Stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Bump Version
id: version-bump
run: |
yarn version --${{ github.event.inputs.bump }} --no-git-tag-version
NEW_VERSION=$(awk '/version/{gsub(/("|",)/,"",$2);print $2}' package.json)
sed -i "/APP_VERSION/c\version = \""$NEW_VERSION"\" # APP_VERSION" ./src-tauri/Cargo.toml
sed -i "/\"version\":/c\ \"version\": \""$NEW_VERSION"\"" ./src-tauri/tauri.conf.json
cd ./src-tauri
cargo generate-lockfile
echo "##[set-output name=new_version;]${NEW_VERSION}"
- name: Commit Version Bump
uses: EndBug/add-and-commit@v9
if: github.event_name != 'repository_dispatch'
with:
default_author: github_actor
author_name: "OpenGOALBot"
author_email: "OpenGOALBot@users.noreply.github.com"
message: "release: bump to version - ${{ steps.version-bump.outputs.new_version }}"
tag: "v${{ steps.version-bump.outputs.new_version }}"