-
-
Notifications
You must be signed in to change notification settings - Fork 5
106 lines (92 loc) · 2.96 KB
/
release-please.yml
File metadata and controls
106 lines (92 loc) · 2.96 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
name: release-please
on:
push:
branches:
- master
permissions:
contents: write
pull-requests: write
jobs:
release:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}
steps:
- name: Release Please
uses: googleapis/release-please-action@v5
id: release
with:
release-type: node
deploy:
needs: release
if: ${{ needs.release.outputs.release_created }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Use Node.js
uses: actions/setup-node@v6
with:
cache: npm
node-version-file: .nvmrc
- name: Install dependencies
run: npm ci --prefer-offline
- name: Build game
shell: bash
run: npm run bundle
env:
VITE_GOOGLE_ANALYTICS_ID: ${{ secrets.GOOGLE_ANALYTICS_ID }}
- name: Get variables
id: vars
shell: bash
run: |
echo "app_name=$(jq -r .short_name public/manifest.json)" >> $GITHUB_OUTPUT
echo "window_title=$(jq -r .name public/manifest.json)" >> $GITHUB_OUTPUT
echo "CHANNEL=$(echo $RUNNER_OS | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
echo "VERSION=$(jq -r .version package.json)" >> $GITHUB_ENV
- name: Setup butler
uses: remarkablegames/setup-butler@v3
- name: Upload web build
if: runner.os == 'Linux'
working-directory: dist
run: |
butler push . $GITHUB_REPOSITORY:html5 --userversion $VERSION
zip -r web.zip .
gh release upload ${{ needs.release.outputs.tag_name }} web.zip
env:
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
GH_TOKEN: ${{ github.token }}
- name: Build app
uses: remarkablemark/tauri-action@v1
id: tauri
with:
app-name: ${{ steps.vars.outputs.app_name }}
app-version: ${{ env.VERSION }}
window-title: ${{ steps.vars.outputs.window_title }}
icon-path: public/app-icon.png
env:
APPLE_SIGNING_IDENTITY: '-'
- name: Upload app to itch.io
run: >
butler push
${{ steps.tauri.outputs.bundle-path }}
${{ github.repository }}:${{ env.CHANNEL }}
--userversion ${{ env.VERSION }}
env:
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
- name: Upload Release Artifact
working-directory: ${{ steps.tauri.outputs.bundle-path }}
shell: bash
run: |
if [[ $RUNNER_OS == 'Windows' ]]; then
7z a -r $CHANNEL.zip ./*
else
zip -r $CHANNEL.zip .
fi
gh release upload ${{ needs.release.outputs.tag_name }} $CHANNEL.zip
env:
GH_TOKEN: ${{ github.token }}