Skip to content

Commit

Permalink
chore(ci): added an action to make GitHub & NPM releases when merging…
Browse files Browse the repository at this point in the history
… a release PR; (#5456)
  • Loading branch information
DigitalBrainJS committed Jan 9, 2023
1 parent 477c714 commit d750901
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: "Publish on merge"
on:
pull_request:
types:
- closed
branches:
- main
jobs:
publish:
if: github.event.pull_request.merged == true && github.event.pull_request.head.label == 'axios:release'
runs-on: ubuntu-latest
steps:
- name: "Release PR info"
run: echo "PR ${{ github.event.number }}"
- uses: actions/checkout@v3
- name: git config
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: npm ci
- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@main
- name: Extract release notes
id: extract-release-notes
uses: ffurrer2/extract-release-notes@v1
- uses: 8BitJonny/gh-get-current-pr@2.2.0
- name: Check versions
run: node ./bin/check-build-version.js
############# TAG RELEASE ##############
- name: "Push tag v${{ steps.package-version.outputs.current-version }}"
uses: rickstaa/action-create-tag@v1
id: tag_version
with:
tag: "v${{ steps.package-version.outputs.current-version }}"
############# GITHUB RELEASE ##############
- name: "Create a GitHub release v${{ steps.package-version.outputs.current-version }}"
uses: ncipollo/release-action@v1
with:
tag: "v${{ steps.package-version.outputs.current-version }}"
name: "Release v${{ steps.package-version.outputs.current-version }}"
body: |
## Release notes:
${{ steps.extract-release-notes.outputs.release_notes }}
############# NPM RELEASE ##############
- name: Publish the release to NPM
run: echo "NPM publish command here" # temporary skipped
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

0 comments on commit d750901

Please sign in to comment.