|
1 | | -name: Release |
2 | | - |
| 1 | +name: Release Please |
3 | 2 | on: |
4 | 3 | push: |
5 | 4 | branches: |
6 | 5 | - main |
7 | | - workflow_dispatch: |
8 | 6 |
|
9 | 7 | jobs: |
10 | | - release-please: |
11 | | - runs-on: ubuntu-latest |
12 | | - outputs: |
13 | | - release_created: ${{ steps.release.outputs.release_created }} |
| 8 | + release: |
14 | 9 | permissions: |
15 | 10 | contents: write |
16 | | - pull-requests: write |
17 | 11 | issues: write |
18 | | - steps: |
19 | | - - uses: googleapis/release-please-action@v4 |
20 | | - id: release |
21 | | - with: |
22 | | - token: ${{ secrets.GITHUB_TOKEN }} |
23 | | - config-file: release-please-config.json |
24 | | - manifest-file: .release-please-manifest.json |
25 | | - |
26 | | - npm-publish: |
27 | | - needs: release-please |
28 | | - if: ${{ needs.release-please.outputs.release_created }} |
29 | | - runs-on: ubuntu-latest |
30 | | - permissions: |
31 | | - contents: read |
32 | | - id-token: write |
33 | | - steps: |
34 | | - - uses: actions/checkout@v4 |
35 | | - - name: Setup Node.js |
36 | | - uses: actions/setup-node@v4 |
37 | | - with: |
38 | | - node-version: '22' |
39 | | - registry-url: 'https://registry.npmjs.org' |
40 | | - cache: 'npm' |
41 | | - - name: Install dependencies |
42 | | - run: npm ci |
43 | | - - name: Build the package |
44 | | - run: npm run build |
45 | | - - name: Publish to NPMJS.org |
46 | | - run: npm publish --provenance --access public |
47 | | - env: |
48 | | - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
49 | | - |
50 | | - upload-release-bundle: |
51 | | - needs: release-please |
52 | | - if: ${{ needs.release-please.outputs.release_created }} |
53 | | - runs-on: ubuntu-latest |
54 | | - permissions: |
55 | | - contents: write |
| 12 | + pull-requests: write |
56 | 13 | id-token: write |
57 | | - |
58 | | - steps: |
59 | | - - uses: actions/checkout@v4 |
60 | | - |
61 | | - - name: Setup Node Environment |
62 | | - run: npm ci |
63 | | - |
64 | | - - name: Set repository name env var |
65 | | - run: echo "REPO_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV |
66 | | - |
67 | | - - name: Build plugin bundle |
68 | | - run: npm run bundle |
69 | | - |
70 | | - - name: Create zipped bundle |
71 | | - run: | |
72 | | - (cd ./dist && zip -r ../${REPO_NAME}.zip .) |
73 | | - tar -C ./dist -czvf ${REPO_NAME}.tar.gz ./ |
74 | | -
|
75 | | - - name: Upload zipped bundle to GitHub release |
76 | | - env: |
77 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
78 | | - run: gh release upload ${{ needs.release-please.outputs.tag_name }} ${REPO_NAME}.zip ${REPO_NAME}.tar.gz |
| 14 | + uses: OMICRONEnergyOSS/oscd-gh-workflows/.github/workflows/release-please.yml@main |
| 15 | + secrets: |
| 16 | + npm_token: ${{ secrets.NPM_TOKEN }} |
| 17 | + gh_token: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments