From df0ae5a7d79bf75bc37a87e1600c652149082797 Mon Sep 17 00:00:00 2001 From: Timo Behrendt Date: Mon, 19 May 2025 21:52:48 +0200 Subject: [PATCH 1/2] ci: add release pipeline --- .gitea/workflows/cd.yaml | 44 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .gitea/workflows/cd.yaml diff --git a/.gitea/workflows/cd.yaml b/.gitea/workflows/cd.yaml new file mode 100644 index 0000000..9e56e38 --- /dev/null +++ b/.gitea/workflows/cd.yaml @@ -0,0 +1,44 @@ +name: CI & Release + +on: + push: + branches: + - main + +jobs: + tests: + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: "stable" + + - name: Download dependencies + run: go mod download + + - name: Run tests + run: go test ./... + + release: + needs: tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: actions/setup-node@v4 + with: + node-version: 22 + - run: npm install -g standard-version + - run: | + git config --global user.name "Release Bot" + git config --global user.email "release-bot@t00n.de" + - run: | + standard-version --no-verify --skip-changelog + git push --follow-tags origin main + env: + GITHUB_TOKEN: ${{ secrets.GITEA_TOKEN }} -- 2.49.1 From 65fc51e87575cab4229cb0c2c740a1c9843cb90f Mon Sep 17 00:00:00 2001 From: Timo Behrendt Date: Tue, 20 May 2025 20:17:43 +0200 Subject: [PATCH 2/2] refactor: cd to re-use ci --- .gitea/workflows/cd.yaml | 18 ++---------------- .gitea/workflows/ci.yaml | 1 + 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/.gitea/workflows/cd.yaml b/.gitea/workflows/cd.yaml index 9e56e38..a6ad54b 100644 --- a/.gitea/workflows/cd.yaml +++ b/.gitea/workflows/cd.yaml @@ -6,22 +6,8 @@ on: - main jobs: - tests: - runs-on: ubuntu-latest - steps: - - name: Check out code - uses: actions/checkout@v4 - - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: "stable" - - - name: Download dependencies - run: go mod download - - - name: Run tests - run: go test ./... + ci: + uses: ./.github/workflows/ci.yaml release: needs: tests diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 583ec19..eeffe47 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -4,6 +4,7 @@ on: push: branches-ignore: - main + workflow_call: jobs: test: -- 2.49.1