2022-04-18 20:30:44 -04:00
|
|
|
name: Release
|
|
|
|
|
|
|
|
on:
|
2022-04-20 00:51:37 -04:00
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- v*
|
2022-04-18 20:30:44 -04:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
publish-tauri:
|
2022-04-20 00:51:37 -04:00
|
|
|
if: github.repository == 'open-goal/launcher'
|
2022-04-18 20:30:44 -04:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2022-04-20 00:51:37 -04:00
|
|
|
include:
|
|
|
|
- platform: ubuntu-latest
|
|
|
|
os: linux
|
|
|
|
- platform: windows-latest
|
|
|
|
os: windows
|
2022-04-18 20:30:44 -04:00
|
|
|
|
|
|
|
runs-on: ${{ matrix.platform }}
|
|
|
|
steps:
|
2022-04-20 00:51:37 -04:00
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.BOT_PAT }}
|
2022-04-18 20:30:44 -04:00
|
|
|
|
2022-04-20 00:51:37 -04:00
|
|
|
- name: setup node
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: 16
|
2022-04-18 20:30:44 -04:00
|
|
|
|
2022-04-20 00:51:37 -04:00
|
|
|
- name: install Rust stable
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
2022-04-18 20:30:44 -04:00
|
|
|
|
2022-04-20 00:51:37 -04:00
|
|
|
- name: install dependencies (ubuntu only)
|
|
|
|
if: matrix.platform == 'ubuntu-latest'
|
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
2022-04-28 01:06:08 -04:00
|
|
|
sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev libglew2.1 patchelf
|
2022-04-18 20:30:44 -04:00
|
|
|
|
2022-04-20 00:51:37 -04:00
|
|
|
- name: install app dependencies
|
|
|
|
run: |
|
|
|
|
npm ci
|
|
|
|
npm run build
|
2022-04-18 20:30:44 -04:00
|
|
|
|
2022-04-20 00:51:37 -04:00
|
|
|
- name: download jak-project release
|
|
|
|
env:
|
|
|
|
JAK_PROJ_VERSION: latest
|
|
|
|
PLATFORM: ${{ matrix.os }}
|
|
|
|
DOWNLOAD_DIR: "./"
|
|
|
|
run: |
|
|
|
|
pushd ./.github/scripts/download-binaries
|
|
|
|
npm ci
|
|
|
|
popd
|
|
|
|
node ./.github/scripts/download-binaries/index.js
|
2022-04-19 20:46:50 -04:00
|
|
|
|
2022-04-28 17:53:56 -04:00
|
|
|
- name: prepare release config
|
|
|
|
run: |
|
|
|
|
npm run prepare-release-config
|
|
|
|
|
2022-04-20 00:51:37 -04:00
|
|
|
- name: prepare resources for build
|
|
|
|
if: matrix.os == 'windows'
|
|
|
|
run: |
|
|
|
|
mv ./opengoal*.zip ./opengoal.zip
|
2022-06-18 20:56:43 -04:00
|
|
|
mkdir ./artifact-out
|
|
|
|
tar -xf opengoal.zip -C ./artifact-out
|
|
|
|
ls ./artifact-out
|
|
|
|
ls ./artifact-out/data
|
2022-04-20 00:51:37 -04:00
|
|
|
mkdir -p ./src-tauri/bin/
|
2022-06-18 20:56:43 -04:00
|
|
|
cp ./artifact-out/*.exe ./src-tauri/bin || true
|
2022-04-20 00:51:37 -04:00
|
|
|
cp ./third-party/glew_2.1.0/windows/glewinfo.exe ./src-tauri/bin
|
2022-06-18 20:56:43 -04:00
|
|
|
cp -r ./artifact-out/data ./src-tauri
|
2022-04-20 00:51:37 -04:00
|
|
|
ls ./src-tauri
|
|
|
|
ls ./src-tauri/bin
|
|
|
|
ls ./src-tauri/data
|
2022-04-19 20:46:50 -04:00
|
|
|
|
2022-04-20 00:51:37 -04:00
|
|
|
- name: prepare resources for build
|
|
|
|
if: matrix.os == 'linux'
|
|
|
|
run: |
|
|
|
|
mv ./opengoal*.tar.gz ./opengoal.tar.gz
|
2022-06-18 20:56:43 -04:00
|
|
|
mkdir ./artifact-out
|
|
|
|
tar -xf opengoal.tar.gz -C ./artifact-out
|
|
|
|
ls ./artifact-out
|
|
|
|
ls ./artifact-out/data
|
2022-04-20 00:51:37 -04:00
|
|
|
mkdir -p ./src-tauri/bin/
|
2022-06-18 20:56:43 -04:00
|
|
|
cp ./artifact-out/* ./src-tauri/bin || true
|
2022-04-20 00:51:37 -04:00
|
|
|
cp ./third-party/glew_2.1.0/linux/glewinfo ./src-tauri/bin
|
2022-06-18 20:56:43 -04:00
|
|
|
cp -r ./artifact-out/data ./src-tauri
|
2022-04-20 00:51:37 -04:00
|
|
|
ls ./src-tauri
|
|
|
|
ls ./src-tauri/bin
|
|
|
|
ls ./src-tauri/data
|
2022-04-19 20:46:50 -04:00
|
|
|
|
2022-04-20 00:51:37 -04:00
|
|
|
- uses: tauri-apps/tauri-action@v0
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
|
|
|
|
with:
|
2022-04-28 17:53:56 -04:00
|
|
|
configPath: "./.tauri/release-config.combined.json"
|
2022-04-20 00:51:37 -04:00
|
|
|
tagName: "v__VERSION__"
|
|
|
|
releaseName: "OpenGOAL Launcher v__VERSION__"
|
|
|
|
releaseBody: "See the assets to download this version and install."
|
2022-04-28 19:59:25 -04:00
|
|
|
releaseDraft: true
|
2022-06-20 22:54:33 -04:00
|
|
|
prerelease: true
|
2022-04-18 20:30:44 -04:00
|
|
|
|
2022-04-28 19:59:25 -04:00
|
|
|
update-release-meta:
|
|
|
|
if: github.repository == 'open-goal/launcher'
|
|
|
|
needs: publish-tauri
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
platform: [ubuntu-latest]
|
|
|
|
runs-on: ${{ matrix.platform }}
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.BOT_PAT }}
|
2022-04-30 23:42:49 -04:00
|
|
|
ref: main
|
2022-04-28 19:59:25 -04:00
|
|
|
|
|
|
|
- name: setup node
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: 16
|
|
|
|
|
|
|
|
- name: update release metadata and publish the release
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.BOT_PAT }}
|
|
|
|
TAG_VALUE: ${{ github.REF }}
|
|
|
|
run: |
|
|
|
|
pushd ./.github/scripts/update-release-metadata
|
|
|
|
npm ci
|
|
|
|
popd
|
|
|
|
node ./.github/scripts/update-release-metadata/index.js
|
|
|
|
|
|
|
|
- name: commit release metadata change
|
|
|
|
uses: EndBug/add-and-commit@v8
|
|
|
|
with:
|
|
|
|
default_author: github_actor
|
|
|
|
author_name: "OpenGOALBot"
|
|
|
|
author_email: "OpenGOALBot@users.noreply.github.com"
|
|
|
|
message: "release: update release metadata to latest"
|