-
Notifications
You must be signed in to change notification settings - Fork 1
90 lines (79 loc) · 2.41 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
90
name: Release
on:
workflow_dispatch:
inputs:
bump:
type: choice
description: 'Bump version'
required: true
default: patch
options:
- patch
- minor
- major
dry_run:
type: boolean
description: 'Dry run'
required: true
default: false
draft:
type: boolean
description: 'Draft release'
required: true
default: false
concurrency:
group: ${{ github.event.repository.name }}-release
cancel-in-progress: true
jobs:
release:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Prepare Git
id: prepare-git
shell: bash
run: |
git config user.name github-actions
git config user.email [email protected]
- uses: actions/setup-node@v4
with:
cache: npm
check-latest: true
node-version-file: .nvmrc
- name: Install dependencies
run: npm ci
- name: Bumb version
id: version
run: |
npm version ${{ github.event.inputs.bump }}
echo "new_tag=$(git describe --tags --abbrev=0 | sed 's/v//')" >> $GITHUB_OUTPUT
- name: Make
run: |
chmod +x add-osx-cert.sh && ./add-osx-cert.sh
npm run make
env:
NOT_SIGN: ${{ github.event.inputs.dry_run }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
CERTIFICATE_OSX_APPLICATION: ${{ secrets.CERTIFICATE_OSX_APPLICATION }}
CERTIFICATE_PASSWORD: ${{ secrets.CERTIFICATE_PASSWORD }}
- name: Generate changelog
id: changelog
uses: mathieudutour/[email protected]
with:
custom_tag: ${{ steps.version.outputs.new_tag }}
github_token: ${{ secrets.GITHUB_TOKEN }}
dry_run: 'true'
- name: Push changes and tags
if: github.event.inputs.dry_run != 'true'
run: |
git push
- name: Create a GitHub release
uses: ncipollo/release-action@v1
with:
tag: v${{ steps.version.outputs.new_tag }}
name: Release v${{ steps.version.outputs.new_tag }}
body: ${{ steps.changelog.outputs.changelog }}
artifacts: 'out/**/*.zip'
draft: ${{ github.event.inputs.draft }}