From cf80e0d72d59b4113b9331d1ba424642cc895029 Mon Sep 17 00:00:00 2001 From: zeevdr Date: Wed, 3 Jun 2026 12:48:49 +0300 Subject: [PATCH] feat(ci): add GitHub release job on tag push Add a `release` job to publish.yml that runs after `publish` succeeds. It builds the dist/ artifact, packages it as a tarball, and creates a GitHub release with auto-generated notes. Alpha/beta/rc tags are marked as pre-releases. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/publish.yml | 36 +++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8dadb35..4ec404c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -41,3 +41,39 @@ jobs: echo "tag=latest" >> $GITHUB_OUTPUT fi - run: npm publish --provenance --access public --tag ${{ steps.tag.outputs.tag }} + + release: + needs: publish + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v6 + - uses: actions/setup-node@v6 + with: + node-version: "22.14" + - run: npm ci + - run: npm run build + - name: Create tarball + run: | + VERSION="${{ github.ref_name }}" + tar -czf "decree-typescript-${VERSION}.tar.gz" dist/ + - name: Determine if prerelease + id: prerelease + run: | + VERSION="${{ github.ref_name }}" + if echo "$VERSION" | grep -qE 'alpha|beta|rc'; then + echo "flag=--prerelease" >> $GITHUB_OUTPUT + else + echo "flag=" >> $GITHUB_OUTPUT + fi + - name: Create GitHub release + env: + GH_TOKEN: ${{ github.token }} + run: | + TAG="${{ github.ref_name }}" + gh release create "$TAG" \ + "decree-typescript-${TAG}.tar.gz" \ + --generate-notes \ + --title "Release ${TAG}" \ + ${{ steps.prerelease.outputs.flag }}