-
-
Notifications
You must be signed in to change notification settings - Fork 738
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow release to run on every commit to main (#3365)
* Allow release to run on every commit to main * Update release-process.md
- Loading branch information
Showing
2 changed files
with
38 additions
and
10 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 |
---|---|---|
@@ -1,11 +1,39 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_dispatch | ||
push: | ||
branches: [main] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
release-check: | ||
name: Check if version changed | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: bash | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
ref: main | ||
|
||
- name: Use Node.js from nvmrc | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: '.nvmrc' | ||
|
||
- name: Check if version changed | ||
id: check | ||
uses: EndBug/version-check@v2 | ||
|
||
outputs: | ||
publish: ${{ steps.check.outputs.changed }} | ||
|
||
release: | ||
name: Release | ||
needs: release-check | ||
if: ${{ needs.release-check.outputs.publish == 'true' }} | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
|
@@ -33,7 +61,6 @@ jobs: | |
- name: Prepare release | ||
id: prepare_release | ||
run: | | ||
echo "version_tag=v${{ steps.package-version.outputs.current-version }}" >> $GITHUB_OUTPUT | ||
RELEASE_TYPE=$(node -e "console.log(require('semver').prerelease('${{ steps.package-version.outputs.current-version }}') ? 'prerelease' : 'regular')") | ||
echo "release_type=$RELEASE_TYPE" >> $GITHUB_OUTPUT | ||
|
@@ -61,6 +88,7 @@ jobs: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_ORG_TOKEN }} | ||
|
||
- name: Tag commit and push | ||
id: tag_version | ||
uses: mathieudutour/[email protected] | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
@@ -85,8 +113,8 @@ jobs: | |
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag: ${{ steps.prepare_release.outputs.version_tag }} | ||
name: ${{steps.prepare_release.outputs.version_tag }} | ||
tag: ${{ steps.tag_version.outputs.new_tag }} | ||
name: ${{ steps.tag_version.outputs.new_tag }} | ||
bodyFile: ${{ steps.release_notes.outputs.release_notes }} | ||
artifacts: "dist.zip" | ||
artifactContentType: "application/zip" | ||
|
@@ -101,8 +129,8 @@ jobs: | |
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ steps.prepare_release.outputs.version_tag }} | ||
release_name: ${{steps.prepare_release.outputs.version_tag }} | ||
tag_name: ${{ steps.tag_version.outputs.new_tag }} | ||
release_name: ${{ steps.tag_version.outputs.new_tag }} | ||
draft: false | ||
prerelease: true | ||
|
||
|
@@ -128,8 +156,8 @@ jobs: | |
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: tmp | ||
destination_dir: benchmarks/${{ steps.prepare_release.outputs.version_tag }} | ||
commit_message: 'deploy: ${{ steps.prepare_release.outputs.version_tag }}' | ||
destination_dir: benchmarks/${{ steps.tag_version.outputs.new_tag }} | ||
commit_message: 'deploy: ${{ steps.tag_version.outputs.new_tag }}' | ||
|
||
- name: Build the Docs | ||
run: | | ||
|
@@ -143,4 +171,4 @@ jobs: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: site | ||
destination_dir: docs | ||
commit_message: 'deploy docs: ${{ steps.prepare_release.outputs.version_tag }}' | ||
commit_message: 'deploy docs: ${{ steps.tag_version.outputs.new_tag }}' |
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