From 1cb4f5338150b56975c55f2bced82f1574754b27 Mon Sep 17 00:00:00 2001 From: Simon Reinisch Date: Sun, 10 Dec 2023 10:04:02 +0100 Subject: [PATCH] chore: add release workflow --- .github/workflows/main.yml | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 23f297b..6292d2b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,8 +12,11 @@ jobs: name: Build app runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: pnpm/action-setup@v2 + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Setup pnpm + uses: pnpm/action-setup@v2 with: version: 8 @@ -39,6 +42,31 @@ jobs: name: app path: dist + publish_release: + if: startsWith(github.event.ref, 'refs/tags/v') + name: Publish new release + needs: build + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + + - name: Extract changes + id: changelog + uses: requarks/changelog-action@v1 + with: + token: ${{ github.token }} + tag: ${{ github.ref_name }} + + - name: Publish release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + body: ${{ steps.changelog.outputs.changes }} + build_docker: if: startsWith(github.event.ref, 'refs/tags/v') name: Build and publish docker image