-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from treedomtrees/chore/update-pipeline
chore(pipeline): apply updated deploy pipeline to the 0.x branch
- Loading branch information
Showing
1 changed file
with
31 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,17 +8,42 @@ on: | |
|
||
jobs: | ||
publish: | ||
name: Publish Release | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
id-token: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: '22.x' | ||
registry-url: 'https://registry.npmjs.org' | ||
- run: PACKAGE_NAME=$(echo "${{ github.ref }}" | sed -E "s:refs/tags/(.+)-v[^-]+$:\1:") | ||
- run: PACKAGE_VERSION=$(echo "${{ github.ref }}" | sed -E "s:refs/tags/.+-(v.+)$:\1:") | ||
- run: npm version $PACKAGE_VERSION --workspace packages/$PACKAGE_NAME | ||
- run: npm install --workspace packages/$PACKAGE_NAME | ||
- run: npm publish --workspace packages/$PACKAGE_NAME --if-present --access public | ||
|
||
- run: | | ||
echo 'package_name=${{ github.ref }}' | sed -E "s:refs/tags/(.+)/v.+$:\1:" >> $GITHUB_ENV | ||
echo 'package_version=${{ github.ref }}' | sed -E "s:refs/tags/.+/(v.+)$:\1:" >> $GITHUB_ENV | ||
- name: Bumping version | ||
run: npm version ${{ env.package_version }} --workspace packages/${{ env.package_name }} | ||
|
||
- name: Install dependencies | ||
run: npm install --workspace packages/${{ env.package_name }} | ||
|
||
- name: Publish to registry | ||
run: npm publish --workspace packages/${{ env.package_name }} --if-present --provenance | ||
env: | ||
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | ||
NODE_AUTH_TOKEN: ${{ secrets.TREEDOM_NPMJS_TOKEN }} | ||
|
||
- name: Commit version | ||
run: | | ||
git config --global user.name "github-actions[bot]" | ||
git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
git add . | ||
git commit -m "chore: bump ${{ env.package_name }} to version ${{ env.package_version }}" || echo "No changes to commit" | ||
- name: Push to main | ||
uses: ad-m/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
branch: main |