From 58ba8eeeb95ddb538dcba3326c42597f5fb4f090 Mon Sep 17 00:00:00 2001 From: jamesread Date: Thu, 23 Oct 2025 23:34:39 +0100 Subject: [PATCH] chore: Simplify semrel pipeline --- .../{build-tag.yml => build-and-release.yml} | 37 +++++++-- .github/workflows/build-snapshot.yml | 78 ------------------- .releaserc.yaml | 2 +- 3 files changed, 30 insertions(+), 87 deletions(-) rename .github/workflows/{build-tag.yml => build-and-release.yml} (65%) delete mode 100644 .github/workflows/build-snapshot.yml diff --git a/.github/workflows/build-tag.yml b/.github/workflows/build-and-release.yml similarity index 65% rename from .github/workflows/build-tag.yml rename to .github/workflows/build-and-release.yml index 3c2afb4..82544b5 100644 --- a/.github/workflows/build-tag.yml +++ b/.github/workflows/build-and-release.yml @@ -1,13 +1,15 @@ --- -name: "Build Tag" +name: "Build & Release pipeline" on: + pull_request: + workflow_dispatch: push: tags: - '*' jobs: - build-tag: + build: runs-on: ubuntu-latest steps: - name: Checkout @@ -54,25 +56,44 @@ jobs: - name: make webui run: make -w webui-dist - - name: goreleaser + - name: unit tests + run: make -w service-unittests + + - name: integration tests + run: cd integration-tests && make -w + + - name: Install goreleaser uses: goreleaser/goreleaser-action@v6 with: - distribution: goreleaser - version: latest - args: release --clean --timeout 60m + install-only: true + + - name: release + if: github.ref_type != 'tag' + uses: cycjimmy/semantic-release-action@v4 + with: + extra_plugins: | + @semantic-release/commit-analyzer + @semantic-release/exec + @semantic-release/git env: GITHUB_TOKEN: ${{ secrets.CONTAINER_TOKEN }} + GH_TOKEN: ${{ secrets.CONTAINER_TOKEN }} + + - name: get date + run: | + echo "DATE=$(date +'%Y-%m-%d')" >> "$GITHUB_ENV" - name: Archive binaries uses: actions/upload-artifact@v4.3.1 with: - name: "OliveTin-${{ github.ref_name }}" + name: "OliveTin-snapshot-${{ env.DATE }}-${{ github.sha }}" path: dist/OliveTin*.* - name: Archive integration tests uses: actions/upload-artifact@v4.3.1 + if: always() with: - name: integration-tests + name: "OliveTin-integration-tests-${{ env.DATE }}-${{ github.sha }}" path: | integration-tests !integration-tests/node_modules diff --git a/.github/workflows/build-snapshot.yml b/.github/workflows/build-snapshot.yml deleted file mode 100644 index 6f03ecf..0000000 --- a/.github/workflows/build-snapshot.yml +++ /dev/null @@ -1,78 +0,0 @@ ---- -name: "Build Snapshot" - -on: - push: - pull_request: - workflow_dispatch: - -jobs: - build-snapshot: - runs-on: ubuntu-latest - if: github.ref_type != 'tag' - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Set up QEMU - id: qemu - uses: docker/setup-qemu-action@v3 - with: - image: tonistiigi/binfmt:latest - platforms: arm64,arm - - - name: Setup node - uses: actions/setup-node@v4 - with: - cache: 'npm' - cache-dependency-path: frontend/package-lock.json - - - name: Setup Go - uses: actions/setup-go@v5 - with: - go-version-file: 'service/go.mod' - cache: true - cache-dependency-path: 'service/go.mod' - - - name: Print go version - run: go version - - - name: make service - run: make -w service - - - name: make webui - run: make -w webui-dist - - - name: unit tests - run: make -w service-unittests - - - name: integration tests - run: cd integration-tests && make -w - - - name: goreleaser - uses: goreleaser/goreleaser-action@v6 - with: - distribution: goreleaser - version: latest - args: release --snapshot --clean --parallelism 1 --skip=docker - - - name: get date - run: | - echo "DATE=$(date +'%Y-%m-%d')" >> "$GITHUB_ENV" - - - name: Archive binaries - uses: actions/upload-artifact@v4.3.1 - with: - name: "OliveTin-snapshot-${{ env.DATE }}-${{ github.sha }}" - path: dist/OliveTin*.* - - - name: Archive integration tests - uses: actions/upload-artifact@v4.3.1 - if: always() - with: - name: "OliveTin-integration-tests-${{ env.DATE }}-${{ github.sha }}" - path: | - integration-tests - !integration-tests/node_modules diff --git a/.releaserc.yaml b/.releaserc.yaml index a1ad25f..e1904aa 100644 --- a/.releaserc.yaml +++ b/.releaserc.yaml @@ -12,6 +12,6 @@ plugins: - '@semantic-release/git' - - "@semantic-release/exec" - publishCmd: | - goreleaser release --clean + goreleaser release --clean --timeout 60m tagFormat: '${version}'