diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..81c22b1 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,47 @@ +name: Release +on: + push: + tags: + - "v*" + 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: Upload artifacts + uses: actions/upload-artifact@v4 + with: + path: pumpkinmc-pumpkin-api-ts-*.tgz + + - name: Upload artifacts to release + if: startsWith(github.ref, 'refs/tags/v') + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + tag: ${{ github.ref }} + file: pumpkinmc-pumpkin-api-ts-*.tgz + overwrite: true + file_glob: true