name: Release on: push: workflow_dispatch: permissions: contents: write pull-requests: write jobs: release: name: Build and release runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v6 with: submodules: true - name: Set up Node uses: actions/setup-node@v6 with: node-version: 24 package-manager-cache: false - name: Install dependencies run: npm install -D - name: Build run: npm pack - name: Set GITHUB_RELEASE_TAG & ARTIFACT_ID run: | set -eux if [[ '${{ github.ref }}' = refs/tags/v* ]]; then tag='${{ github.ref }}' tag="${tag:10}" artifactID="${tag:1}" else tag=CI artifactID='${{ github.sha }}' artifactID="${artifactID:0:8}" fi echo "GITHUB_RELEASE_TAG=$tag" >> $GITHUB_ENV echo "ARTIFACT_ID=$artifactID" >> $GITHUB_ENV - name: Rename artifacts run: | mv pumpkinmc-pumpkin-api-ts-*.tgz pumpkinmc-pumpkin-api-ts-${ARTIFACT_ID}.tgz - name: Upload artifacts uses: actions/upload-artifact@v4 with: path: pumpkinmc-pumpkin-api-ts-*.tgz - name: Upload artifacts to release uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} tag: ${{ env.GITHUB_RELEASE_TAG }} file: pumpkinmc-pumpkin-api-ts-*.tgz overwrite: true file_glob: true