2022-04-20 00:51:37 -04:00
|
|
|
name: Kick off Release
|
|
|
|
|
|
|
|
on:
|
|
|
|
repository_dispatch:
|
|
|
|
types: [releaseLauncher]
|
|
|
|
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:
|
2022-06-22 00:00:47 -04:00
|
|
|
- uses: actions/checkout@v3
|
2022-04-20 00:51:37 -04:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.BOT_PAT }}
|
|
|
|
|
2022-08-22 20:33:29 -04:00
|
|
|
- name: Setup Node
|
2022-06-21 22:34:08 -04:00
|
|
|
uses: actions/setup-node@v3
|
2022-04-20 00:51:37 -04:00
|
|
|
with:
|
|
|
|
node-version: 16
|
2022-08-08 20:01:11 -04:00
|
|
|
cache: npm
|
|
|
|
|
|
|
|
- name: Install Rust Stable
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
2022-04-20 00:51:37 -04:00
|
|
|
|
2022-08-22 20:33:29 -04:00
|
|
|
- name: Bump Version - Manual Kickoff
|
2022-04-20 00:51:37 -04:00
|
|
|
id: version-bump
|
2022-08-22 20:33:29 -04:00
|
|
|
if: github.event_name != 'repository_dispatch'
|
2022-04-20 00:51:37 -04:00
|
|
|
run: |
|
|
|
|
npm 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
|
2022-08-08 20:01:11 -04:00
|
|
|
cd ./src-tauri
|
2022-08-11 23:39:54 -04:00
|
|
|
cargo generate-lockfile
|
2022-04-20 00:51:37 -04:00
|
|
|
echo "##[set-output name=new_version;]${NEW_VERSION}"
|
|
|
|
|
2022-08-22 20:33:29 -04:00
|
|
|
- name: Commit Version Bump
|
2022-06-21 22:34:38 -04:00
|
|
|
uses: EndBug/add-and-commit@v9
|
2022-08-22 20:33:29 -04:00
|
|
|
if: github.event_name != 'repository_dispatch'
|
2022-04-20 00:51:37 -04:00
|
|
|
with:
|
|
|
|
default_author: github_actor
|
|
|
|
author_name: "OpenGOALBot"
|
|
|
|
author_email: "OpenGOALBot@users.noreply.github.com"
|
2022-04-28 19:59:25 -04:00
|
|
|
message: "release: bump to version - ${{ steps.version-bump.outputs.new_version }}"
|
2022-04-20 00:51:37 -04:00
|
|
|
tag: "v${{ steps.version-bump.outputs.new_version }}"
|
2022-08-22 20:33:29 -04:00
|
|
|
|
|
|
|
- name: Bump Minor Version - Jak Project Release
|
|
|
|
id: version-bump-jak-prj
|
|
|
|
if: github.event_name == 'repository_dispatch'
|
|
|
|
run: |
|
|
|
|
npm version minor --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-jak-prj.outputs.new_version }}"
|
|
|
|
tag: "v${{ steps.version-bump-jak-prj.outputs.new_version }}"
|