Skip to content

Commit e060aeb

Browse files
authored
ci: migrate to manifest config (#173)
1 parent fc0af81 commit e060aeb

File tree

3 files changed

+70
-31
lines changed

3 files changed

+70
-31
lines changed

.github/release-please/config.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"release-type": "node",
4+
"prerelease": false,
5+
"include-component-in-tag": false,
6+
"bootstrap-sha": "aa33cf5a1dcd5794772d38e1c5ba5a421c8156b7",
7+
"changelog-sections": [
8+
{ "type": "feat", "section": "🌟 Features", "hidden": false },
9+
{ "type": "fix", "section": "🩹 Fixes", "hidden": false },
10+
{ "type": "docs", "section": "📚 Documentation", "hidden": false },
11+
12+
{ "type": "chore", "section": "🧹 Chores", "hidden": false },
13+
{ "type": "perf", "section": "🧹 Chores", "hidden": false },
14+
{ "type": "refactor", "section": "🧹 Chores", "hidden": false },
15+
{ "type": "test", "section": "🧹 Chores", "hidden": false },
16+
17+
{ "type": "build", "section": "🤖 Automation", "hidden": false },
18+
{ "type": "ci", "section": "🤖 Automation", "hidden": true }
19+
],
20+
"packages": { ".": {} }
21+
}

.github/release-please/mainfest.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{".":"3.0.1"}

.github/workflows/release-please.yml

Lines changed: 48 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,40 +4,57 @@ on:
44
- main
55
name: release-please
66

7-
permissions:
8-
id-token: write # to enable use of OIDC for npm provenance
97

108
jobs:
119
release-please:
10+
name: Create/Update Release Pull Request
1211
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
pull-requests: write
15+
outputs:
16+
release_created: ${{ steps.release.outputs.release_created }}
17+
major: ${{ steps.release.outputs.major }}
18+
minor: ${{ steps.release.outputs.minor }}
19+
patch: ${{ steps.release.outputs.patch }}
1320
steps:
14-
- uses: GoogleCloudPlatform/release-please-action@v2
15-
id: release
16-
with:
17-
release-type: node
18-
package-name: test-release-please
19-
# The logic below handles the npm publication:
20-
- uses: actions/checkout@v4
21-
# these if statements ensure that a publication only occurs when
22-
# a new release is created:
23-
if: ${{ steps.release.outputs.release_created }}
24-
- uses: actions/setup-node@v4
25-
with:
26-
node-version: 18
27-
registry-url: 'https://registry.npmjs.org'
28-
if: ${{ steps.release.outputs.release_created }}
29-
- run: npm ci
30-
if: ${{ steps.release.outputs.release_created }}
31-
- run: npm publish --provenance
32-
env:
33-
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
34-
if: ${{ steps.release.outputs.release_created }}
21+
- name: Release Please
22+
id: release
23+
uses: googleapis/release-please-action@v4
24+
with:
25+
config-file: .github/release-please/config.json
26+
manifest-file: .github/release-please/manifest.json
3527

36-
# Tweets out release announcement
37-
- run: 'npx @humanwhocodes/tweet "${{ github.event.repository.full_name }} v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }} has been released!\n\n${{ github.event.repository.html_url }}/releases/tag/v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }}"'
38-
if: ${{ steps.release.outputs.release_created }}
39-
env:
40-
TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }}
41-
TWITTER_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }}
42-
TWITTER_ACCESS_TOKEN_KEY: ${{ secrets.TWITTER_ACCESS_TOKEN_KEY }}
43-
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
28+
publish-npm:
29+
name: Publish to NPM
30+
needs: release-please
31+
if: needs.release-please.outputs.release_created == 'true'
32+
runs-on: ubuntu-latest
33+
permissions:
34+
contents: read
35+
id-token: write
36+
steps:
37+
- name: Check out repo
38+
uses: actions/checkout@v4
39+
with:
40+
persist-credentials: false
41+
42+
- name: Setup Node
43+
uses: actions/setup-node@v4
44+
with:
45+
check-latest: true
46+
node-version: lts/*
47+
registry-url: https://registry.npmjs.org
48+
49+
- name: Publish to NPM
50+
env:
51+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
52+
run: npm publish --access public --provenance
53+
54+
# Tweets out release announcement
55+
- run: 'npx @humanwhocodes/tweet "${{ github.event.repository.full_name }} v${{ needs.release-please.outputs.major }}.${{ needs.release-please.outputs.minor }}.${{ needs.release-please.outputs.patch }} has been released!\n\n${{ github.event.repository.html_url }}/releases/tag/v${{ needs.release-please.outputs.major }}.${{ needs.release-please.outputs.minor }}.${{ needs.release-please.outputs.patch }}"'
56+
env:
57+
TWITTER_CONSUMER_KEY: ${{ secrets.TWITTER_CONSUMER_KEY }}
58+
TWITTER_CONSUMER_SECRET: ${{ secrets.TWITTER_CONSUMER_SECRET }}
59+
TWITTER_ACCESS_TOKEN_KEY: ${{ secrets.TWITTER_ACCESS_TOKEN_KEY }}
60+
TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}

0 commit comments

Comments
 (0)