Skip to content

Commit

Permalink
Updating how we do versioning
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Nowak <[email protected]>
  • Loading branch information
rynowak committed Dec 24, 2024
1 parent e969e63 commit 1f9d690
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
- features/*
- release/*
env:
CI_PUBLISH: ${{ github.event_name == 'pull_request' && github.event.action == 'opened' }}
CI_PUBLISH: ${{ github.event_name != 'pull_request' && github.event.action != 'opened' }}
jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -66,10 +66,13 @@ jobs:
- name: Install dependencies
run: yarn install --immutable

- name: Install dependencies
run: cat ${{ env.NPM_CONFIG_USERCONFIG }}

- name: Publish
if: ${{ env.CI_PUBLISH }}
shell: bash
env:
PUBLISH_ARGS: --access public --new-version 0.0.1-alpha+${{ env.COMMIT }} --tag alpha
PUBLISH_ARGS: --access public --tag alpha
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn run publish:all
run: yarn run publish:all 0.0.1-alpha.${{ env.COMMIT }}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"format-check:all": "yarn run prettier --check .",
"format:all": "yarn run prettier --write .",
"lint:all": "yarn run eslint .",
"publish:all": "yarn workspaces foreach -A run npm publish $PUBLISH_ARGS",
"publish:all": "yarn workspace @radius-project/manifest-to-bicep-extension run version ${0} && yarn workspace @radius-project/manifest-to-bicep-extension run publish $PUBLISH_ARGS",
"test:all": "jest",
"test:ci": "jest --ci --reporters default --reporters github-actions"
},
Expand Down
10 changes: 6 additions & 4 deletions packages/manifest-to-bicep-extension/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "@radius-project/manifest-to-bicep-extension",
"version": "0.0.1",
"version": "0.0.1-alpha",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/radius-project/bicep-tools.git"
"url": "git+https://github.com/radius-project/bicep-tools.git"
},
"publishConfig": {
"access": "public",
"provenance": true,
"registry": "@radius-project:https://npm.pkg.github.com"
"@radius-project:registry": "https://npm.pkg.github.com"
},
"packageManager": "[email protected]",
"files": [
Expand All @@ -19,6 +19,8 @@
"scripts": {
"build": "tsc",
"watch": "tsc -w",
"prepublishOnly": "yarn build"
"publish": "npm publish",
"prepublishOnly": "yarn build",
"version": "npm pkg set version=${0}"
}
}

0 comments on commit 1f9d690

Please sign in to comment.