-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (94 loc) · 3.58 KB
/
Copy pathrelease.yaml
File metadata and controls
109 lines (94 loc) · 3.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: Release
permissions:
contents: read
on:
push:
tags:
- v[0-9]+.*
jobs:
create-release:
runs-on: ubuntu-latest
permissions:
contents: write # for taiki-e/create-gh-release-action
steps:
- uses: actions/checkout@v6
- uses: taiki-e/create-gh-release-action@v1
with:
changelog: CHANGELOG.md
upload-assets:
needs: create-release
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-apple-darwin
os: macos-latest
- target: x86_64-pc-windows-msvc
os: windows-latest
runs-on: ${{ matrix.os }}
permissions:
contents: write # for taiki-e/upload-rust-binary-action
steps:
- uses: actions/checkout@v6
- uses: taiki-e/upload-rust-binary-action@v1
with:
# (required) Binary names (non-extension portion of filename) to build and upload (whitespace or comma separated list).
# Note that glob pattern is not supported yet.
bin: scoreboard-engine
manifest-path: engine/Cargo.toml
include: README.md,CHANGELOG.md,engine/config.xml,engine/pages,examples
# (optional) Target triple, default is host triple.
# This is optional but it is recommended that this always be set to
# clarify which target you are building for if macOS is included in
# the matrix because GitHub Actions changed the default architecture
# of macos-latest since macos-14.
target: ${{ matrix.target }}
# (optional) On which platform to distribute the `.tar.gz` file.
# [default value: unix]
# [possible values: all, unix, windows, none]
tar: unix
# (optional) On which platform to distribute the `.zip` file.
# [default value: windows]
# [possible values: all, unix, windows, none]
zip: windows
upload-companion:
runs-on: ubuntu-latest
needs: create-release
permissions:
contents: write
defaults:
run:
working-directory: companion-module-scoreboard-engine
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v5
with:
node-version: '22.20'
cache: 'yarn'
cache-dependency-path: './companion-module-scoreboard-engine/package.json'
- name: Install Dependencies
run: yarn install
- name: Get version from package.json
id: get_version
run: |
VERSION=$(node -p "require('./package.json').version")
echo "pkg_version=$VERSION" >> $GITHUB_OUTPUT
- name: Get Latest Release Tag
id: get_release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Fetches the tag name of the most recent release
LATEST_TAG=$(gh release view --json tagName --template '{{.tagName}}')
echo "tag=$LATEST_TAG" >> $GITHUB_OUTPUT
- name: Build Companion Module
run: yarn companion-module-build
- run: mv scoreboard-engine-${{ steps.get_version.outputs.pkg_version }}.tgz companion-module-scoreboard-engine-${{ steps.get_version.outputs.pkg_version }}.tgz
- name: Upload Zip to Latest Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
ZIP_NAME="companion-module-scoreboard-engine-${{ steps.get_version.outputs.pkg_version }}.tgz"
echo "Uploading $ZIP_NAME to release ${{ steps.get_release.outputs.tag }}..."
gh release upload ${{ steps.get_release.outputs.tag }} "$ZIP_NAME" --clobber