Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 24 additions & 7 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
- 'oidc-consumer/**'

release:
environment: ${{ github.ref_name == 'main' && 'Prod' || '' }}
name: Bump package-version and create release
runs-on: ubuntu-latest
needs: changes
Expand All @@ -35,10 +36,26 @@ jobs:
matrix:
package: ${{ fromJSON(needs.changes.outputs.packages) }}
steps:

- name: Generate token
if: ${{ github.ref_name == 'main' }}
id: generate_token
uses: tibdex/github-app-token@v2
with:
app_id: ${{ vars.FUNDABOT_APP_ID }}
private_key: ${{ secrets.FUNDABOT_PRIVATE_KEY }}

- uses: actions/checkout@v3
if: ${{ github.ref_name == 'main' }}
with:
token: ${{ steps.generate_token.outputs.token }}

- uses: actions/checkout@v3
if: ${{ github.ref_name != 'main' }}

- run: |
git config user.name github-actions
git config user.email github-actions@github.com
git config user.name "fundabot"
git config user.email "fundabot@fundwave.com"
git pull origin ${{ github.ref }}

- name: ${{ matrix.package }} version bump
Expand Down Expand Up @@ -102,11 +119,11 @@ jobs:
env:
VERSION: ${{ steps.version.outputs.newTag }}
run: |
git commit -am "CI: bumped ${{ matrix.package }} version to $VERSION"
git config user.email "fundabot@fundwave.com"
git config user.name "fundabot"
git commit -am "CI: bumps oidc-consumer version to $VERSION" -m "[skip ci]"
git tag "v$VERSION" HEAD -m "CI: bumps version to $VERSION"

- name: Push changes
if: always()
uses: ad-m/github-push-action@master
with:
github_token: ${{ env.GITHUB_TOKEN }}
branch: ${{ github.ref }}
run: git push --follow-tags --atomic --no-verify