-
Notifications
You must be signed in to change notification settings - Fork 25
63 lines (52 loc) · 1.86 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
name: Release
# Taken from: https://github.com/changesets/action#with-publishing
on:
workflow_dispatch:
push:
branches:
- main
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
release:
name: Changelog PR or Release
if: ${{ github.repository_owner == 'kadena-community' }}
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
pull-requests: write
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
steps:
- uses: actions/checkout@v4
with:
show-progress: false
token: ${{ secrets.RELEASE_ACTION_GITHUB_TOKEN }}
- name: Runner setup
uses: ./.github/actions/runner-setup
- name: Lint monorepo root
run: pnpm run lint
- name: Cache for Turbo
uses: rharkor/caching-for-turbo@v1.5
- name: Build, lint, test all packages
run: pnpm turbo lint build test
- name: Create Release PR or Publish
id: changesets
uses: changesets/action@v1
with:
# Note: pnpm install after versioning is necessary to refresh lockfile
version: pnpm run version
publish: pnpm run publish
commit: 'Update changelogs and bump versions'
title: '[ci] Release'
env:
# Needs "Contents" r+w and "Pull requests" r+w access to open/update PRs and push to main
GITHUB_TOKEN: ${{ secrets.RELEASE_ACTION_GITHUB_TOKEN }}
# Needs r+w access for packages of both orgs to publish to npm
NPM_TOKEN: ${{ secrets.RELEASE_ACTION_NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true
- name: Output (debug)
if: steps.changesets.outputs.published == 'true'
# Do something more interesting when a publish happens.
run: echo ${{ steps.changesets.outputs.publishedPackages }}