-
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.
STAT-12: Update workflow to use timestamp for dev release.
- Loading branch information
1 parent
df614de
commit 4fc2e91
Showing
1 changed file
with
24 additions
and
7 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 |
---|---|---|
|
@@ -4,6 +4,7 @@ on: | |
push: | ||
branches-ignore: | ||
- 'master' | ||
|
||
jobs: | ||
build-and-publish-dev: | ||
runs-on: ubuntu-latest | ||
|
@@ -13,12 +14,28 @@ jobs: | |
with: | ||
node-version: 20 | ||
registry-url: https://registry.npmjs.org/ | ||
- run: yarn install --frozen-lockfile | ||
- run: yarn test | ||
- run: | | ||
while true; do | ||
npm version prerelease --preid=dev --no-git-tag-version | ||
npm publish --tag dev && break | ||
done | ||
|
||
- name: Install dependencies | ||
run: yarn install --frozen-lockfile | ||
|
||
- name: Run tests | ||
run: yarn test | ||
|
||
- name: Get current version | ||
id: package-version | ||
uses: martinbeentjes/[email protected] | ||
|
||
- name: Generate unique version | ||
id: generate-version | ||
run: | | ||
current_version=$(echo ${{ steps.package-version.outputs.current-version}} | sed 's/-dev\.[0-9]\+$//') | ||
timestamp=$(date +%Y%m%d%H%M%S) | ||
echo "new_version=${current_version}-dev.${timestamp}" >> $GITHUB_OUTPUT | ||
- name: Update version | ||
run: npm version ${{ steps.generate-version.outputs.new_version }} --no-git-tag-version | ||
|
||
- name: Publish to npm | ||
run: npm publish --tag dev | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |