-
Notifications
You must be signed in to change notification settings - Fork 1
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 #109 from CareEvolution/AdjustCicd
Adjust cicd workflows to publish release and snapshot/prerelease tags slightly differently.
- Loading branch information
Showing
3 changed files
with
49 additions
and
1 deletion.
There are no files selected for viewing
3 changes: 2 additions & 1 deletion
3
.github/workflows/cicd.yml → .github/workflows/cicd-release.yml
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
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,35 @@ | ||
name: Publish to npmjs and ProGet (snapshots / prereleases) | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
tags: | ||
- "*-*" | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
jobs: | ||
run: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: "17.3.0" | ||
- name: Install Dependencies | ||
run: npm ci | ||
- name: Run Build | ||
run: npm run rollup | ||
- name: Deploy to npmjs | ||
run: | | ||
npm config set @careevolution:registry=https://registry.npmjs.org/ | ||
npm config set //registry.npmjs.org/:_authToken ${{ secrets.NPMJS_TOKEN }} | ||
npm publish --tag next --access public | ||
- name: Deploy to ProGet | ||
run: | | ||
echo "@careevolution:registry=https://proget.careevolution.com/npm/npm/" > .npmrc | ||
npm config set @careevolution:registry=https://proget.careevolution.com/npm/npm/ | ||
npm config set //proget.careevolution.com/npm/npm/:_authToken ${{ secrets.PROGET_TOKEN }} | ||
npm publish --tag next |
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,12 @@ | ||
$branch= &git rev-parse --abbrev-ref HEAD | ||
|
||
if($branch -eq "main"){ | ||
throw 'Cannot snapshot the main branch' | ||
} | ||
|
||
$branch = ($branch -split "/")[-1] | ||
|
||
$newVersion = npm version prerelease --preid $branch | ||
echo $newVersion | ||
git push | ||
git push origin $newVersion |