From 00f5f4557b886bf29fbf95c22d80cce2644497b7 Mon Sep 17 00:00:00 2001 From: Yuri Blankenstein <72129129+Yuri-Blankenstein-TNO@users.noreply.github.com> Date: Mon, 5 Feb 2024 16:03:20 +0100 Subject: [PATCH 1/2] Exit if workflow_dispatch on other branch than main --- .github/workflows/ci.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 14e5560..e039bee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,15 +6,25 @@ on: workflow_dispatch: inputs: type: - description: 'Release type (patch/minor/major)' + description: 'Release type (major/minor/patch)' default: 'patch' required: true + type: choice + options: + - major + - minor + - patch jobs: ci: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - name: Exit if workflow_dispatch on other branch than main + if: (github.event_name == 'workflow_dispatch') && (github.ref_name != 'refs/heads/main') + run: | + echo "Release workflow should be runned from main branch, exiting." + exit 1 - uses: actions/setup-node@v3 with: node-version: 18 From 922601f0c78df6a61b948b07df7c36927a6108f8 Mon Sep 17 00:00:00 2001 From: Yuri Blankenstein <72129129+Yuri-Blankenstein-TNO@users.noreply.github.com> Date: Mon, 5 Feb 2024 16:09:51 +0100 Subject: [PATCH 2/2] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 41ce248..bc9d7ef 100644 --- a/README.md +++ b/README.md @@ -53,4 +53,4 @@ To develop Tracy: - Changes made to `src/extension/*` are **NOT** applied on-the-fly, to apply them go to *Run* (menu bar) -> *Restart Debugging*. ## Creating a new release -To create a new release, go to the [CI GitHub action](https://github.com/TNO/vscode-tracy/actions/workflows/ci.yml) -> *Run workflow* -> adjust type accordingly -> *Run workflow*. Wait till build completes and add the [release notes](https://github.com/TNO/vscode-tracy/releases/latest). +To create a new release, go to the [CI GitHub action](https://github.com/TNO/vscode-tracy/actions/workflows/ci.yml) -> *Run workflow* -> Choose *Branch*: **main** -> adjust the *Release type* accordingly -> *Run workflow*. Wait till build completes and add the [release notes](https://github.com/TNO/vscode-tracy/releases/latest).