Skip to content

Commit

Permalink
chore: switch to automated releases
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Jan 29, 2025
1 parent 7ca7bd4 commit 07bdebd
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 1,135 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/changelog-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: release

on:
pull_request_target:
types: [closed]
branches:
- main

permissions:
pull-requests: write
contents: write

jobs:
release:
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'v')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4

- 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: |
TAG_NAME=${{ github.event.pull_request.head.ref }}
RELEASE_NAME=${{ github.event.pull_request.head.ref }}
BODY=${{ github.event.pull_request.body }}
gh release create $TAG_NAME --title "$RELEASE_NAME" --notes "$BODY"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42 changes: 42 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: release

on:
push:
tags:
- 'v*'

# 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:
group: release
permissions:
id-token: write
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- run: corepack enable
- uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
with:
node-version: lts/*
registry-url: 'https://registry.npmjs.org/'
cache: pnpm

- name: 📦 Install dependencies
run: pnpm install

- name: 🛠 Build project
run: pnpm build

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

0 comments on commit 07bdebd

Please sign in to comment.