diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index b9e408df2..8e57aede7 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -1,14 +1,27 @@ name: Publish Extension on: - push: - tags: - - "v0.8.*-vscode" - branches: - - main + release: + types: [released] jobs: + check_release_name: + runs-on: ubuntu-latest + outputs: + should_run: ${{ steps.check.outputs.should_run }} + steps: + - id: check + working-directory: . + run: | + if [[ "${{ github.event.release.tag_name }}" == v0.8.*-vscode ]]; then + echo "should_run=true" >> $GITHUB_OUTPUT + else + echo "should_run=false" >> $GITHUB_OUTPUT + fi + build: + needs: check_release_name + if: needs.check_release_name.outputs.should_run == 'true' strategy: matrix: include: diff --git a/.github/workflows/preview.yaml b/.github/workflows/preview.yaml index 87b28f9df..a87079e18 100644 --- a/.github/workflows/preview.yaml +++ b/.github/workflows/preview.yaml @@ -1,14 +1,27 @@ name: Publish Preview Extension on: - push: - tags: - - "v0.9.*-vscode" - branches: - - dev + release: + types: [prereleased] jobs: + check_release_name: + runs-on: ubuntu-latest + outputs: + should_run: ${{ steps.check.outputs.should_run }} + steps: + - id: check + working-directory: . + run: | + if [[ "${{ github.event.release.tag_name }}" == v0.9.*-vscode ]]; then + echo "should_run=true" >> $GITHUB_OUTPUT + else + echo "should_run=false" >> $GITHUB_OUTPUT + fi + build: + needs: check_release_name + if: needs.check_release_name.outputs.should_run == 'true' strategy: matrix: include: