-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add experimental release script
- Loading branch information
1 parent
0ac469e
commit d672c20
Showing
2 changed files
with
70 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: 'Experimental Releases' | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
release: | ||
name: 'Release' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup npmrc | ||
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18 | ||
|
||
- name: Get yarn cache directory path | ||
id: yarn-cache-dir | ||
run: echo "::set-output name=dir::$(yarn cache dir)" | ||
|
||
- name: Restore yarn cache | ||
uses: actions/cache@v3 | ||
id: yarn-cache | ||
with: | ||
path: ${{ steps.yarn-cache-dir.outputs.dir }} | ||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn- | ||
- name: Install | ||
run: yarn install | ||
|
||
- run: ./scripts/version-and-publish.sh | ||
env: | ||
VERSION: '${{ github.sha }}' | ||
DIST_TAG: experimental |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
|
||
# Force start from root folder | ||
cd "$(dirname "$0")/.." | ||
|
||
set -e | ||
|
||
version=$VERSION | ||
distTag=$DIST_TAG | ||
|
||
if [[ -z "$version" ]]; then | ||
echo "Please enter the version you want to publish" | ||
read -r version | ||
fi | ||
|
||
if [[ -z "$distTag" ]]; then | ||
echo "Please enter the dist-tag you want to publish with" | ||
read -r distTag | ||
fi | ||
|
||
|
||
echo "$version" | ||
|
||
# publish packages | ||
./node_modules/.bin/changeset version --snapshot "$version" | ||
./node_modules/.bin/changeset publish --no-git-tag --snapshot --tag "$distTag" |