Skip to content

Commit

Permalink
ci: consolidate into single release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Jan 29, 2025
1 parent d09ea27 commit 854abd1
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 40 deletions.
33 changes: 0 additions & 33 deletions .github/workflows/changelog-merge.yml

This file was deleted.

30 changes: 23 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
name: release

on:
push:
tags:
- 'v*'
pull_request_target:
types: [closed]
branches:
- main

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

jobs:
release:
if: github.repository_owner == 'nuxt' && startsWith(github.event.head_commit.message, 'v')
concurrency:
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'v')
concurrency:

Check failure on line 16 in .github/workflows/release.yml

View workflow job for this annotation

GitHub Actions / lint

Trailing spaces not allowed

Check failure on line 16 in .github/workflows/release.yml

View workflow job for this annotation

GitHub Actions / lint

Trailing spaces not allowed
group: release
permissions:
contents: write
id-token: write
runs-on: ubuntu-latest
timeout-minutes: 20
Expand All @@ -35,8 +37,22 @@ jobs:
- name: 🛠 Build project
run: pnpm build

- name: 📦 release nightly
- name: 📦 Release
run: node ./scripts/release.mjs
env:
NPM_TOKEN: ${{ secrets.NPM_RELEASE_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_RELEASE_TOKEN }}
NPM_CONFIG_PROVENANCE: true

- name: 🏷️ Create tag
run: |
TAG_NAME=${{ github.event.pull_request.head.ref }}
git tag $TAG_NAME
git push origin $TAG_NAME
- name: 🛳️ Create GitHub release
run: gh release create $TAG_NAME --title "$RELEASE_NAME" --notes "$BODY"

Check failure on line 53 in .github/workflows/release.yml

View workflow job for this annotation

GitHub Actions / lint

Extra space before value for key 'run'

Check failure on line 53 in .github/workflows/release.yml

View workflow job for this annotation

GitHub Actions / lint

Multiple spaces found before 'gh release create $TAG_NAME --title "$RELEASE_NAME" --notes "$BODY"'

Check failure on line 53 in .github/workflows/release.yml

View workflow job for this annotation

GitHub Actions / lint

Multiple spaces found before 'gh release create $TAG_NAME --title "$RELEASE_NAME" --notes "$BODY"'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG_NAME: ${{ github.event.pull_request.head.ref }}
RELEASE_NAME: ${{ github.event.pull_request.head.ref }}
BODY: ${{ github.event.pull_request.body }}

0 comments on commit 854abd1

Please sign in to comment.