Skip to content

Commit

Permalink
Add release test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Kesin11 committed May 12, 2024
1 parent 2660112 commit 5636b79
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/release_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Prepublish for release test
on:
push:
branches:
- publishing_from_local
workflow_dispatch:
jobs:
prerelease:
runs-on: ubuntu-latest
environment:
name: prod
url: https://www.npmjs.com/package/junit2json
permissions:
contents: write
id-token: write
if: github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 'lts'
registry-url: 'https://registry.npmjs.org'
- uses: earthly/[email protected]
with:
version: latest
github-token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4

# Use GitHub App for bypassing ruleset guard when git push by npm publish
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.BYPASS_APP_ID }}
private-key: ${{ secrets.BYPASS_APP_PRIVATE_KEY }}
# npm publish and push updated package.json
- name: PrePublish
run: |
npm run release:prepublish
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
NODE_AUTH_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}

- name: Commit and push changes
run: |
git config --global user.name "github-actions"
git config --global user.email "[email protected]"
git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/".insteadOf "https://github.com/"
git add package*.json
git commit -m "debug: npm run release:prepublish"
git push

0 comments on commit 5636b79

Please sign in to comment.