Skip to content

Commit

Permalink
ci: swap release process to release-please (#508)
Browse files Browse the repository at this point in the history
**What is the purpose of this pull request?**

To improve the release process by swapping to release-please. Fixes #506

**What changes did you make? (Give an overview)**

Removed `cycjimmy/semantic-release-action` and added
`googleapis/release-please-action`
  • Loading branch information
voxpelli authored Jul 24, 2024
1 parent 948c097 commit e1ce2ad
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 48 deletions.
21 changes: 21 additions & 0 deletions .github/release-please/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/v16.12.0/schemas/config.json",
"release-type": "node",
"include-component-in-tag": false,
"changelog-sections": [
{ "type": "feat", "section": "🌟 Features", "hidden": false },
{ "type": "fix", "section": "🩹 Fixes", "hidden": false },
{ "type": "docs", "section": "📚 Documentation", "hidden": false },

{ "type": "chore", "section": "🧹 Chores", "hidden": false },
{ "type": "perf", "section": "🧹 Chores", "hidden": false },
{ "type": "refactor", "section": "🧹 Chores", "hidden": false },
{ "type": "test", "section": "🧹 Chores", "hidden": false },

{ "type": "build", "section": "🤖 Automation", "hidden": false },
{ "type": "ci", "section": "🤖 Automation", "hidden": true }
],
"packages": {
".": {}
}
}
1 change: 1 addition & 0 deletions .github/release-please/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ ".": "7.0.0" }
47 changes: 2 additions & 45 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@ name: CI
on:
push:
branches:
# default semantic-release branches
- +([0-9])?(.{+([0-9]),x}).x
- main
- next
- next-major
- beta
- alpha
pull_request:

concurrency:
Expand All @@ -26,10 +20,10 @@ jobs:
- name: ⎔ Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
node-version: lts/*

- name: 📥 Install dependencies
run: npm install
run: npm ci

- name: ▶️ Run lint script
run: npm run lint
Expand Down Expand Up @@ -81,40 +75,3 @@ jobs:

- name: ⬆️ Upload coverage report
uses: codecov/codecov-action@v4

release:
name: 🚀 Release
needs: [lint, test]
runs-on: ubuntu-latest
if:
github.repository == 'eslint-community/eslint-plugin-promise' &&
contains('refs/heads/main,refs/heads/next,refs/heads/beta,refs/heads/alpha',
github.ref) && github.event_name == 'push'
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4

- name: ⎔ Setup node
uses: actions/setup-node@v4
with:
node-version: 18

- name: 📥 Install dependencies
run: npm install

- name: 🚀 Release
uses: cycjimmy/semantic-release-action@v4
with:
semantic_version: 19
branches: |
[
'+([0-9])?(.{+([0-9]),x}).x',
'main',
'next',
'next-major',
{name: 'beta', prerelease: true},
{name: 'alpha', prerelease: true}
]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
- name: ⎔ Setup node
uses: actions/setup-node@v4
with:
node-version: 18
node-version: lts/*

- name: 📥 Install deps
run: npm install
run: npm ci

- name: 👔 Format
run: npm run format
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Release Please

on:
push:
branches:
- main

permissions:
contents: read

jobs:
release_please:
name: release-please
runs-on: ubuntu-latest
outputs:
releaseCreated: ${{ steps.release.outputs.release_created }}
permissions:
contents: write
pull-requests: write
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
config-file: .github/release-please/config.json
manifest-file: .github/release-please/manifest.json

npm_publish:
name: Publish to npm
runs-on: ubuntu-latest
needs: release_please
if: needs.release_please.outputs.releaseCreated
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
with:
show-progress: false
- uses: actions/setup-node@v4
with:
node-version: lts/*
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-plugin-promise",
"version": "0.0.0-semantically-released",
"version": "7.0.0",
"description": "Enforce best practices for JavaScript promises",
"keywords": [
"eslint",
Expand Down

0 comments on commit e1ce2ad

Please sign in to comment.