From d395d76d04e9614413021d9591883327bcf77cc4 Mon Sep 17 00:00:00 2001 From: Patryk Hegenberg Date: Wed, 4 Jun 2025 13:31:10 +0200 Subject: [PATCH] ci: update pipelines --- .forgejo/workflows/build.yml | 21 -------------- .forgejo/workflows/ci.yml | 30 ++++++++++++++++++++ .forgejo/workflows/release.yml | 50 ++++++++++++++++++++++++++++++++++ 3 files changed, 80 insertions(+), 21 deletions(-) delete mode 100644 .forgejo/workflows/build.yml create mode 100644 .forgejo/workflows/ci.yml create mode 100644 .forgejo/workflows/release.yml diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml deleted file mode 100644 index b739818..0000000 --- a/.forgejo/workflows/build.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Build workctl - -on: [push, pull_request] - -jobs: - build-and-run: - runs-on: ubuntu-22.04 - - steps: - - name: Check out repository - uses: actions/checkout@v4 - - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: '1.24' - - - name: Build Go application - run: | - go mod tidy - go build -o workctl . diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml new file mode 100644 index 0000000..82610ab --- /dev/null +++ b/.forgejo/workflows/ci.yml @@ -0,0 +1,30 @@ +name: Go CI Pipeline + +on: [push, pull_request] + +jobs: + ci: + runs-on: ubuntu-22.04 + + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.24' + + - name: Get dependencies + run: go mod tidy + + - name: Lint code + run: | + go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest + golangci-lint run + + - name: Run tests + run: go test -v ./... + + - name: Build application + run: go build -o workctl . diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml new file mode 100644 index 0000000..5aa9e3d --- /dev/null +++ b/.forgejo/workflows/release.yml @@ -0,0 +1,50 @@ +name: Release Builds + +on: + push: + tags: + - 'v*' + +jobs: + build: + runs-on: ubuntu-22.04 + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + goos: [linux, darwin, windows] + exclude: + - os: ubuntu-latest + goos: darwin + - os: ubuntu-latest + goos: windows + - os: macos-latest + goos: linux + - os: macos-latest + goos: windows + - os: windows-latest + goos: linux + - os: windows-latest + goos: darwin + + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.24' + + - name: Get dependencies + run: go mod tidy + + - name: Build for ${{ matrix.goos }} + run: | + GOOS=${{ matrix.goos }} GOARCH=amd64 go build -o workctl-${{ matrix.goos }} . + ls -la + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: workctl-${{ matrix.goos }} + path: workctl-${{ matrix.goos }}