-
Notifications
You must be signed in to change notification settings - Fork 67
70 lines (58 loc) · 1.88 KB
/
release.yml
File metadata and controls
70 lines (58 loc) · 1.88 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
name: Release
on:
push:
branches:
- master
workflow_dispatch:
concurrency: ${{ github.workflow }}-${{ github.ref }}
permissions:
id-token: write
contents: write
pull-requests: write
env:
SECRETS: ${{ toJSON(secrets) }}
ELECTRON_VERSION: 41.0.0
jobs:
release:
name: Release
runs-on: ubuntu-latest
outputs:
published: ${{ steps.changesets.outputs.published }}
steps:
- name: Checkout Repo
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Install Linux dependencies
run: sudo apt-get update && sudo apt-get install -y libssl-dev pkg-config
- name: Setup Project
uses: ./.github/actions/setup-node-pnpm
with:
registry-url: https://registry.npmjs.org
- name: Verify
run: pnpm test
- name: Ensure pending changesets exist for dev publish
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
if ! find .changeset -maxdepth 1 -name '*.md' ! -name 'README.md' -print -quit | grep -q .; then
echo "No pending changesets found. Add a changeset before running a dev publish."
exit 1
fi
- name: Dev Publish
if: ${{ github.event_name == 'workflow_dispatch' }}
run: pnpm release:dev
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Prod Create Release Pull Request or Publish
if: ${{ github.event_name == 'push' }}
uses: changesets/action@v1
id: changesets
with:
version: pnpm version-packages
publish: pnpm release
env:
GITHUB_TOKEN: ${{ github.token }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# Phase 1 intentionally publishes source-build-only packages for macOS and Linux.