Skip to content

Commit

Permalink
ci: add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Mar 16, 2024
1 parent 073afc3 commit 76604ce
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 9 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/release-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: ci

on:
push:
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:
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'nuxt' && github.event_name == 'push' }}
permissions:
id-token: write
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- run: corepack enable
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: 20
registry-url: "https://registry.npmjs.org/"
cache: "pnpm"

- name: Install dependencies
run: pnpm install

- name: Prepare build environment
run: pnpm dev:prepare

- name: nightly release
run: pnpm changelogen --canary nightly --publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
NPM_CONFIG_PROVENANCE: true
21 changes: 12 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
name: ci
name: release

on:
push:
branches:
- main
workflow_dispatch:

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

jobs:
release:
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'nuxt' && github.event_name == 'push' }}
if: github.repository_owner == 'nuxt'
permissions:
id-token: write
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- run: corepack enable
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
Expand All @@ -28,8 +31,8 @@ jobs:
- name: Prepare build environment
run: pnpm dev:prepare

- name: nightly release
run: pnpm changelogen --canary nightly --publish
- name: Release
run: pnpm changelogen --publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.RELEASE_NODE_AUTH_TOKEN }}
NPM_CONFIG_PROVENANCE: true

0 comments on commit 76604ce

Please sign in to comment.