diff --git a/.github/workflows/github_relase.yml b/.github/workflows/github_relase.yml new file mode 100644 index 0000000..e384912 --- /dev/null +++ b/.github/workflows/github_relase.yml @@ -0,0 +1,16 @@ +name: Create Github Release +on: + push: + tags: + - "v*" + +jobs: + release: + name: Create Github Release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: "marvinpinto/action-automatic-releases@latest" + with: + repo_token: "${{ secrets.MY_GITHUB_TOKEN }}" + prerelease: false diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 75869c4..08df59d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,10 +28,23 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.MY_GITHUB_TOKEN }} + - name: Check version + id: check_version + run: ./scripts/check_version + continue-on-error: true + - name: Publish If + id: publish env: VSCE_PAT: ${{ secrets.VSCE_PAT }} OPENVSX_PAT: ${{ secrets.OPENVSX_PAT }} - if: steps.changesets.outputs.hasChangesets == 'false' + if: steps.check_version.outcome == 'success' # You can do something when a publish should happen. run: npm run publish:vscode && npm run publish:openvsx -- -p ${{ secrets.OPENVSX_PAT }} + + - name: Tag Version + if: steps.publish.outcome == 'success' + uses: Klemensas/action-autotag@1.2.3 + with: + GITHUB_TOKEN: "${{ secrets.MY_GITHUB_TOKEN }}" + tag_prefix: "v" diff --git a/scripts/check_version b/scripts/check_version index f25232a..e4054ce 100755 --- a/scripts/check_version +++ b/scripts/check_version @@ -2,7 +2,6 @@ const { execSync } = require("child_process"); const packageJson = require("../package.json"); -console.log("Comparing version number before pushing into main"); const current_version = packageJson.version;