From 61149f6fd7e2b5309b02bc8756e834eb0f446c7e Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Thu, 12 Dec 2024 12:44:08 +0100 Subject: [PATCH] Replace CI system --- .github/workflows/test-and-build.yml | 58 ++++++++++++++++++++++++++++ .repo-runner.yaml | 10 ----- 2 files changed, 58 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/test-and-build.yml delete mode 100644 .repo-runner.yaml diff --git a/.github/workflows/test-and-build.yml b/.github/workflows/test-and-build.yml new file mode 100644 index 0000000..d63b1f6 --- /dev/null +++ b/.github/workflows/test-and-build.yml @@ -0,0 +1,58 @@ +--- + +name: test-and-build +on: + push: + branches: ['*'] + tags: ['v*'] + +permissions: + contents: write + issues: write + +jobs: + test-and-build: + defaults: + run: + shell: bash + + container: + image: luzifer/gh-arch-env + env: + CGO_ENABLED: 0 + GOPATH: /go + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Marking workdir safe + run: git config --global --add safe.directory /__w/continuous-spark/continuous-spark + + - name: 'Lint and test code' + run: | + go test -cover -v ./... + golangci-lint run ./... + + - name: Build release + run: make publish + env: + FORCE_SKIP_UPLOAD: 'true' + MOD_MODE: readonly + NO_TESTS: 'true' + PACKAGES: '.' + + - name: Extract changelog + run: 'awk "/^#/ && ++c==2{exit}; /^#/f" "History.md" | tail -n +2 >release_changelog.md' + + - name: Release + uses: ncipollo/release-action@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + artifacts: '.build/*' + bodyFile: release_changelog.md + draft: false + generateReleaseNotes: false + +... diff --git a/.repo-runner.yaml b/.repo-runner.yaml deleted file mode 100644 index 74b4056..0000000 --- a/.repo-runner.yaml +++ /dev/null @@ -1,10 +0,0 @@ ---- - -image: "reporunner/golang-alpine" -checkout_dir: /go/src/github.com/Luzifer/continuous-spark - -commands: - - make publish - -environment: - CGO_ENABLED: 0