|
1 | | -name: Publish CI |
| 1 | +name: Create Release |
2 | 2 |
|
3 | 3 | on: |
4 | | - push: |
5 | | - branches: [master] |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + prerelease: |
| 7 | + type: boolean |
| 8 | + description: Mark as pre-release? |
6 | 9 |
|
7 | 10 | jobs: |
8 | | - publish: |
| 11 | + create-release: |
9 | 12 | runs-on: ubuntu-latest |
| 13 | + permissions: |
| 14 | + contents: write |
| 15 | + packages: write |
10 | 16 | steps: |
11 | 17 | - uses: actions/checkout@v3 |
12 | 18 | - uses: actions/setup-node@v3 |
13 | 19 | with: |
14 | | - node-version: "18.x" |
15 | | - registry-url: "https://npm.pkg.github.com" |
16 | | - scope: "@euler-xyz" |
17 | | - - run: npm ci |
18 | | - - run: npm run build --if-present |
19 | | - - run: | |
20 | | - git config user.name github-actions |
21 | | - git config user.email github-actions@github.com |
22 | | - npm version patch |
23 | | - git push |
24 | | - git push --tags |
25 | | - - run: npm publish --registry=https://npm.pkg.github.com/ --access restricted |
| 20 | + node-version: 18 |
| 21 | + registry-url: https://npm.pkg.github.com/ |
| 22 | + |
| 23 | + - name: Conventional Changelog Action |
| 24 | + id: changelog |
| 25 | + uses: TriPSs/conventional-changelog-action@v3 |
| 26 | + with: |
| 27 | + release-count: 50 |
| 28 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 29 | + |
| 30 | + - name: Create Release |
| 31 | + uses: actions/create-release@v1 |
| 32 | + if: ${{ steps.changelog.outputs.skipped == 'false' }} |
26 | 33 | env: |
27 | | - # NOTE: using the built-in GITHUB token here because we're publishing to THIS repository's packages. |
| 34 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 35 | + with: |
| 36 | + prerelease: ${{ github.event.inputs.prerelease }} |
| 37 | + tag_name: ${{ steps.changelog.outputs.tag }} |
| 38 | + release_name: ${{ steps.changelog.outputs.tag }} |
| 39 | + body: ${{ steps.changelog.outputs.clean_changelog }} |
| 40 | + |
| 41 | + - name: Install dependencies |
| 42 | + if: ${{ steps.changelog.outputs.skipped == 'false' }} |
| 43 | + run: yarn |
| 44 | + env: |
| 45 | + # This is needed because we need to install the linting packages |
28 | 46 | NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 47 | + |
| 48 | + # - name: Authenticate with the GitHub Package Registry |
| 49 | + # if: ${{ steps.changelog.outputs.skipped == 'false' }} |
| 50 | + # run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> |
| 51 | + # ~/.npmrc |
| 52 | + |
| 53 | + - name: Github publish package |
| 54 | + if: ${{ steps.changelog.outputs.skipped == 'false' }} |
| 55 | + uses: JS-DevTools/npm-publish@v3 |
| 56 | + with: |
| 57 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 58 | + registry: "https://npm.pkg.github.com" |
0 commit comments