-
-
Notifications
You must be signed in to change notification settings - Fork 35
89 lines (80 loc) · 3.2 KB
/
release.yml
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
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
build:
runs-on: ${{ matrix.os }}
# Platforms to build on/for
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-13]
node-version: [20.18.0]
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
# install dbus-1 dep for xosms
- if: matrix.os == 'ubuntu-latest'
name: install ubuntu deps
run: |
sudo apt update
sudo apt install libdbus-1-dev snapd
sudo snap install snapcraft --classic
- if: matrix.os == 'windows-latest'
name: install windows deps
uses: GuillaumeFalourd/setup-windows10-sdk-action@v1.8
with:
sdk-version: 19041
- if: github.ref_type == 'tag'
id: getVersion
uses: actions/github-script@v7.0.1
env:
REF_NAME: ${{ github.ref_name }}
with:
script: |
const isVersion = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/
const id = process.env.REF_NAME && process.env.REF_NAME.split('v')[1] || process.env.REF_NAME
core.setOutput("value", id);
core.setOutput("ok", isVersion.test(id))
- if: github.ref_type == 'tag' && steps.getVersion.outputs.ok
name: set app version
uses: jossef/action-set-json-field@v2.2
with:
file: package.json
field: version
value: "${{ steps.getVersion.outputs.value }}"
- name: Install dependencies
run: |
yarn config set ignore-engines true
yarn --frozen-lockfile
- name: Build Electron release
run: yarn release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VUE_APP_SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
VUE_APP_DISCORD_CLIENT_ID: ${{ secrets.DISCORD_CLIENT_ID }}
VUE_APP_LASTFM_API: ${{ secrets.LASTFM_API }}
VUE_APP_LASTFM_SECRET: ${{ secrets.LASTFM_SECRET }}
VUE_APP_GITHUB_REPOSITORY: ${{ github.repository }}
- if: matrix.os == 'ubuntu-latest'
name: Upload release source maps to sentry
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_PROJECT: ytmdesktop
SENTRY_ORG: venipa
SENTRY_DEPLOY_ENVIRONMENT: production
run: |
# Install Sentry CLI
curl -sL https://sentry.io/get-cli/ | bash
# Create new Sentry release
export SENTRY_RELEASE=$(sentry-cli releases propose-version)
sentry-cli releases new -p $SENTRY_PROJECT $SENTRY_RELEASE
sentry-cli releases set-commits --auto $SENTRY_RELEASE
sentry-cli releases finalize $SENTRY_RELEASE
# Create new deploy for this Sentry release
sentry-cli releases deploys $SENTRY_RELEASE new -e $SENTRY_DEPLOY_ENVIRONMENT