Skip to content

Commit

Permalink
workflow: setup automated release with provenance
Browse files Browse the repository at this point in the history
  • Loading branch information
haoqunjiang committed Nov 11, 2024
1 parent e1e5458 commit 7fe208c
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
10 changes: 10 additions & 0 deletions .github/MAINTENANCE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
This document explains how to perform the project's maintenance tasks.

### Creating a new release

Anyone with write access to the repository can request a new release. To do so, follow these steps:

1. Run `pnpm version <patch|minor|major>` locally to bump the version number and create a new commit / tag.
2. Push the commit and tag to the repository by running `git push --follow-tags`.
3. The release will be automatically published to npm by GitHub Actions once approved by an administrator.
4. Go to <https://github.com/vuejs/create-eslint-config/releases/new> and create a new release with the tag that was just created. Describe the notable changes in the release notes.
24 changes: 24 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Release

on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
release:
# Use Publish environment for deployment protection
environment: Publish
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
registry-url: 'https://registry.npmjs.org'
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
},
"homepage": "https://github.com/vuejs/create-eslint-config#readme",
"publishConfig": {
"access": "public"
"access": "public",
"provenance": true
},
"dependencies": {
"ejs": "^3.1.10",
Expand Down

0 comments on commit 7fe208c

Please sign in to comment.