Skip to content

Commit 854abd1

Browse files
committed
ci: consolidate into single release workflow
1 parent d09ea27 commit 854abd1

File tree

2 files changed

+23
-40
lines changed

2 files changed

+23
-40
lines changed

.github/workflows/changelog-merge.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
name: release
22

33
on:
4-
push:
5-
tags:
6-
- 'v*'
4+
pull_request_target:
5+
types: [closed]
6+
branches:
7+
- main
78

89
# Remove default permissions of GITHUB_TOKEN for security
910
# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
1011
permissions: {}
1112

1213
jobs:
1314
release:
14-
if: github.repository_owner == 'nuxt' && startsWith(github.event.head_commit.message, 'v')
15-
concurrency:
15+
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'v')
16+
concurrency:
1617
group: release
1718
permissions:
19+
contents: write
1820
id-token: write
1921
runs-on: ubuntu-latest
2022
timeout-minutes: 20
@@ -35,8 +37,22 @@ jobs:
3537
- name: 🛠 Build project
3638
run: pnpm build
3739

38-
- name: 📦 release nightly
40+
- name: 📦 Release
3941
run: node ./scripts/release.mjs
4042
env:
41-
NPM_TOKEN: ${{ secrets.NPM_RELEASE_TOKEN }}
43+
NODE_AUTH_TOKEN: ${{ secrets.NPM_RELEASE_TOKEN }}
4244
NPM_CONFIG_PROVENANCE: true
45+
46+
- name: 🏷️ Create tag
47+
run: |
48+
TAG_NAME=${{ github.event.pull_request.head.ref }}
49+
git tag $TAG_NAME
50+
git push origin $TAG_NAME
51+
52+
- name: 🛳️ Create GitHub release
53+
run: gh release create $TAG_NAME --title "$RELEASE_NAME" --notes "$BODY"
54+
env:
55+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
TAG_NAME: ${{ github.event.pull_request.head.ref }}
57+
RELEASE_NAME: ${{ github.event.pull_request.head.ref }}
58+
BODY: ${{ github.event.pull_request.body }}

0 commit comments

Comments
 (0)