diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e6effb6..608a071 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -5,7 +5,9 @@ name: Publish on: push: - tags: 'v*' + tags: + - 'v*' + - 'pre*' jobs: build: @@ -68,7 +70,16 @@ jobs: - name: Create release env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + RELEASE_NAME: ${{ github.ref_name }} run: | - gh release create "${{ github.ref_name }}" \ - --title "Release ${{ github.ref_name }}" \ + # If the release name starts with "pre", draft release + FLAGS="" + if [[ "$RELEASE_NAME" == pre* ]]; then + FLAGS="--prerelease --draft" + fi + + # Create the release with the appropriate flags + gh release create "$RELEASE_NAME" \ + --title "Release $RELEASE_NAME" \ + $FLAGS \ ProxySwitcher.zip