From d6cfbd99f7a57ec1d5adb397953db3341486a1e5 Mon Sep 17 00:00:00 2001 From: Leonid Beschastny Date: Tue, 10 Oct 2023 23:25:36 +0200 Subject: [PATCH] Automatically create GH release for each tag --- .github/workflows/release.yaml | 26 ++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..3675cfa --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,26 @@ +name: Create release + +on: + push: + tags: + - 'v*' + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v3 + with: + node-version: '20.x' + cache: 'npm' + + - run: npm ci + + - run: npm pack + + - uses: ncipollo/release-action@v1 + with: + artifacts: "cwebp-*.tgz" + generateReleaseNotes: true diff --git a/package.json b/package.json index ee3d0d3..6febc0e 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "clean": "rm -rf lib/ cwebp-*.tgz", "test": "mocha test/*.coffee", "list-files": "tar -tzf `npm pack | tail -n 1`", - "prepublish": "npm run clean && coffee -o lib/ -cb src/", + "prepack": "npm run clean && coffee -o lib/ -cb src/", "postpublish": "git push origin +HEAD:latest --follow-tags" }, "engines": {