Skip to content

Commit

Permalink
chore: update github workflows to push versions smartly
Browse files Browse the repository at this point in the history
  • Loading branch information
Viijay-Kr authored Jan 8, 2024
1 parent 9323b42 commit 5f637da
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 2 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/github_relase.yml
Original file line number Diff line number Diff line change
@@ -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
15 changes: 14 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
with:
GITHUB_TOKEN: "${{ secrets.MY_GITHUB_TOKEN }}"
tag_prefix: "v"
1 change: 0 additions & 1 deletion scripts/check_version
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 5f637da

Please sign in to comment.