diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bd98c8a..52c58e3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,25 +7,6 @@ on: workflow_dispatch: jobs: - preflight: - runs-on: ubuntu-latest - outputs: - is_pre_release: ${{ steps.get_version.outputs.is_pre_release }} - version: ${{ steps.get_version.outputs.version }} - steps: - - id: get_version - run: | - VERSION="${GITHUB_REF#refs/*/}" - - if [[ "$VERSION" =~ ^v\d+\.\d+\.\d+$ ]]; then - IS_PRE_RELEASE="false" - else - IS_PRE_RELEASE="true" - fi - - echo "is_pre_release=${IS_PRE_RELEASE}" >> "$GITHUB_OUTPUT" - echo "version=${VERSION}" >> "$GITHUB_OUTPUT" - build: uses: ./.github/workflows/build.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fef82dd..5aa6461 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,19 +4,55 @@ name: Release on: push: tags: - - "**" + - "v**" permissions: contents: write jobs: + preflight: + runs-on: ubuntu-latest + outputs: + is_pre_release: ${{ steps.get_version.outputs.is_pre_release }} + version: ${{ steps.get_version.outputs.version }} + steps: + - id: get_version + run: | + VERSION="${GITHUB_REF#refs/*/}" + + if [[ "$VERSION" =~ ^v\d+\.\d+\.\d+$ ]]; then + IS_PRE_RELEASE="false" + else + IS_PRE_RELEASE="true" + fi + + echo "is_pre_release=${IS_PRE_RELEASE}" + echo "is_pre_release=${IS_PRE_RELEASE}" >> "$GITHUB_OUTPUT" + echo "version=${VERSION}" + echo "version=${VERSION}" >> "$GITHUB_OUTPUT" + build: uses: ./.github/workflows/build.yml + needs: preflight release: runs-on: ubuntu-latest - needs: build + needs: + - preflight + - build steps: - uses: actions/checkout@v4 - - run: echo $GITHUB_REF + - run: | + echo "version=${{ needs.preflight.outputs.version }}" + echo "is_pre_release=${{ needs.preflight.outputs.is_pre_release }}" + + # - id: create_release + # uses: actions/create-release@v1 + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # with: + # # tag_name: ${{ github.ref }} + # release_name: ${{ needs.preflight.outputs.version }} + # # draft: true + # prerelease: ${{ needs.build.outputs.is_pre_release }}