Skip to content

Commit c78c116

Browse files
committedMar 16, 2024
ci: release in ci when a v3 tag is pushed
1 parent 5a387d5 commit c78c116

File tree

4 files changed

+42
-6
lines changed

4 files changed

+42
-6
lines changed
 

‎.github/workflows/changelogensets.yml renamed to ‎.github/workflows/changelog.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Release
1+
name: changelog
22

33
on:
44
push:
@@ -15,7 +15,7 @@ concurrency:
1515
cancel-in-progress: ${{ github.event_name != 'push' }}
1616

1717
jobs:
18-
update-changelog:
18+
update:
1919
if: github.repository_owner == 'nuxt' && !contains(github.event.head_commit.message, 'v3.')
2020
runs-on: ubuntu-latest
2121

‎.github/workflows/release-pr.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: release
1+
name: release-pr
22

33
on:
44
issue_comment:

‎.github/workflows/release.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
# Remove default permissions of GITHUB_TOKEN for security
9+
# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
10+
permissions: {}
11+
12+
jobs:
13+
release:
14+
if: github.repository == 'nuxt/nuxt' && startsWith(github.event.head_commit.message, 'v3.')
15+
permissions:
16+
id-token: write
17+
runs-on: ubuntu-latest
18+
timeout-minutes: 20
19+
steps:
20+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
21+
with:
22+
fetch-depth: 0
23+
- run: corepack enable
24+
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
25+
with:
26+
node-version: 20
27+
cache: "pnpm"
28+
29+
- name: Install dependencies
30+
run: pnpm install
31+
32+
- name: Build (stub)
33+
run: pnpm dev:prepare
34+
35+
- name: Release
36+
run: ./scripts/release.sh
37+
env:
38+
NODE_AUTH_TOKEN: ${{secrets.RELEASE_NODE_AUTH_TOKEN}}
39+
NPM_CONFIG_PROVENANCE: true

‎scripts/release.sh

-3
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,3 @@ for PKG in packages/* ; do
2424
pnpm publish --access public --no-git-checks --tag $TAG
2525
popd > /dev/null
2626
done
27-
28-
# Restore environment to dev mode
29-
pnpm dev:prepare

0 commit comments

Comments
 (0)