-
Notifications
You must be signed in to change notification settings - Fork 1
56 lines (48 loc) · 1.39 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
name: Release and version
on:
workflow_dispatch:
push:
branches:
- main
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
publish-release:
name: Release
runs-on: ubuntu-latest
if: github.repository == 'ethereum-optimism/super-cli'
permissions:
contents: write
pull-requests: write
id-token: write
steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: "main"
- name: Setup
uses: ./.github/actions/setup
- name: Check if NPM_TOKEN is set
id: check_token
run: |
if [ -z "${{ secrets.NPM_TOKEN }}" ]; then
echo "NPM_TOKEN is not set. Is it set it in your repository secrets?"
exit 1
fi
shell: bash
- name: Set deployment token
run: npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Verify NPM Token is valid
run: npm whoami
- name: Publish To NPM or Create Release Pull Request
uses: changesets/action@v1
id: changesets
with:
createGithubReleases: false
publish: pnpm release:publish
version: pnpm release:version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}