Skip to content

Commit

Permalink
Update release-please workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
kinyoklion committed Feb 21, 2024
1 parent 847127d commit c48af9c
Showing 1 changed file with 16 additions and 37 deletions.
53 changes: 16 additions & 37 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,49 +6,28 @@ on:
- main

jobs:
release-package:
release-please:
runs-on: ubuntu-latest

permissions:
id-token: write # Needed if using OIDC to get release secrets.
contents: write # Contents and pull-requests are for release-please to make releases.
pull-requests: write
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
command: manifest
token: ${{secrets.GITHUB_TOKEN}}
default-branch: main

- uses: actions/checkout@v4
if: ${{ steps.release.outputs.releases_created }}
with:
fetch-depth: 0 # If you only need the current version remove this line.
outputs:
releases_created: ${{ steps.release.outputs.releases_created }}

- uses: launchdarkly/gh-actions/actions/release-secrets@release-secrets-v1.0.0
if: ${{ steps.release.outputs.releases_created }}
name: 'Get your token!'
with:
# The AWS_ROLE_ARN needs added as a var to your repo.
aws_assume_role: ${{ vars.AWS_ROLE_ARN }}
# This example uses the node release token, it will get set into the NODE_AUTH_TOKEN
# environment variable. The action readme contains more information.
ssm_parameter_pairs: '/production/common/releasing/npm/token = NODE_AUTH_TOKEN'

- uses: ./.github/actions/ci
if: ${{ steps.release.outputs.releases_created }}

- uses: ./.github/actions/publish
if: ${{ steps.release.outputs.releases_created }}
steps:
- uses: google-github-actions/release-please-action@v4
id: release
with:
# If publishing somewhere else, then get the token from SSM. If you need both github,
# and another token, then add more tokens to the composite action. Could be $NODE_AUTH_TOKEN
# from the release-secrets action earlier in this workflow.
token: ${{secrets.GITHUB_TOKEN}}
token: ${{ secrets.GITHUB_TOKEN }}
target-branch: ${{ github.ref_name }}

- uses: ./.github/actions/publish-docs
if: ${{ steps.release.outputs.releases_created }}
with:
# If publishing somewhere else, then get the token from SSM. If you need both github,
# and another token, then add more tokens to the composite action.
token: ${{secrets.GITHUB_TOKEN}}
call-workflow-publish:
needs: release-please
uses: ./.github/workflows/publish.yml
if: ${{ needs.release-please.outputs.releases_created == 'true' }}
with:
run_tests: true
dry_run: false

0 comments on commit c48af9c

Please sign in to comment.