Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align release process by supporting npm provenance and tag and release-directory #1216

Merged
merged 1 commit into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .github/actions/get-release-notes/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ name: Return the release notes extracted from the PR body
# TODO: Remove once the common repo is public.
#
inputs:
version :
version:
required: true
repo_name:
required: false
Expand Down
16 changes: 15 additions & 1 deletion .github/actions/publish-package/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ inputs:
required: true
npm-token:
required: true
version:
required: true
release-directory:
default: './'

runs:
using: composite
Expand All @@ -27,6 +31,16 @@ runs:

- name: Publish release to NPM
shell: bash
run: npm publish
working-directory: ${{ inputs.release-directory }}
run: |
if [[ "${VERSION}" == *"beta"* ]]; then
TAG="beta"
elif [[ "${VERSION}" == *"alpha"* ]]; then
TAG="alpha"
else
TAG="latest"
fi
npm publish --provenance --tag $TAG
env:
NODE_AUTH_TOKEN: ${{ inputs.npm-token }}
VERSION: ${{ inputs.version }}
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ on:

permissions:
contents: write
id-token: write # For publishing to npm using --provenance

env:
NODE_VERSION: 18
Expand Down Expand Up @@ -36,7 +37,7 @@ jobs:
uses: ./.github/actions/get-prerelease
with:
version: ${{ steps.get_version.outputs.version }}

# Get the release notes
# This will expose the release notes as env.RELEASE_NOTES
- id: get_release_notes
Expand All @@ -62,6 +63,7 @@ jobs:
- uses: ./.github/actions/publish-package
with:
node-version: ${{ env.NODE_VERSION }}
version: ${{ steps.get_version.outputs.version }}
npm-token: ${{ secrets.NPM_TOKEN }}

# Create a release for the tag
Expand Down