Skip to content

Commit

Permalink
task: trying new strategy for version
Browse files Browse the repository at this point in the history
  • Loading branch information
paganotoni committed Nov 18, 2022
1 parent dcd21e4 commit 1f1a494
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions .github/workflows/test-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,24 @@ jobs:

- run: npm test
if: runner.os != 'Linux'

- name: get release version
if: success() && startsWith(github.ref, 'refs/tags/') && matrix.os == 'ubuntu-latest'
id: release_version
run: |
TAGGED_VERSION="${GITHUB_REF/refs\/tags\/v/}"
if [[ ! "${TAGGED_VERSION}" =~ ^[0-9]+\.[0-9]+\.[0-9]+.*$ ]]; then
echo "Invalid version tag '${TAGGED_VERSION}'"
exit 1
fi
echo "EXT_VERSION=${TAGGED_VERSION}" >> $GITHUB_ENV
- name: stamp version
if: success() && startsWith(github.ref, 'refs/tags/') && matrix.os == 'ubuntu-latest'
run: |
cat package.json | jq --arg VER "${{ env.EXT_VERSION }}" '.version=$VER' > /tmp/package.json
cp /tmp/package.json ./package.json
- name: Publish
if: success() && startsWith(github.ref, 'refs/tags/') && matrix.os == 'ubuntu-latest'
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"pretest": "npm run compile && npm run lint",
"lint": "eslint src --ext ts",
"test": "node ./out/test/runTest.js",
"deploy": "vsce publish $VERSION"
"deploy": "vsce publish"
},
"devDependencies": {
"@types/glob": "^7.1.4",
Expand Down

0 comments on commit 1f1a494

Please sign in to comment.