From 5c033194abbd510e83964d34e0ce38aa01b7fb37 Mon Sep 17 00:00:00 2001 From: kalvn Date: Tue, 24 Dec 2024 14:36:53 +0100 Subject: [PATCH] build: add Github Action release pipeline --- .github/workflows/release.yml | 40 +++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a538bca --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,40 @@ +name: Release Shaarli Material + +on: + push: + tags: + - 'v[0-9]+\.[0-9]+\.[0-9]+(-.*)?' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: "20.x" + + - name: Build plugin + run: | + npm install + npm run build + + - name: Package + run: | + tag="${GITHUB_REF#refs/tags/}" + zip -r shaarli-material.$tag.zip material + tar -czvf shaarli-material.$tag.tar.gz material + + - name: Create release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + tag="${GITHUB_REF#refs/tags/}" + + gh release create "$tag" \ + --title="$tag" \ + --draft \ + shaarli-material.$tag.zip shaarli-material.$tag.tar.gz