From c48af9ce7568477bb54542dbc382ca76b89ecbab Mon Sep 17 00:00:00 2001 From: Ryan Lamb <4955475+kinyoklion@users.noreply.github.com> Date: Tue, 20 Feb 2024 16:30:09 -0800 Subject: [PATCH] Update release-please workflow. --- .github/workflows/release-please.yml | 53 +++++++++------------------- 1 file changed, 16 insertions(+), 37 deletions(-) diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 4e7b148..ab5a23f 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -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