diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 3163b5a7..fc496394 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -1,4 +1,5 @@ name: Docs + on: push: branches: @@ -6,6 +7,7 @@ on: permissions: contents: write + jobs: deploy: runs-on: ubuntu-latest diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index c32b55d6..fde88cc5 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,8 +1,9 @@ -name: Test, Lint +name: Golang on: push: pull_request: + release: jobs: test: @@ -64,3 +65,29 @@ jobs: version: latest skip-cache: true args: --timeout=5m + + build: + strategy: + matrix: + include: + - arch: amd64 + os: linux + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - uses: actions/setup-go@v2 + with: + go-version: '1.21' + - name: Build + run: go build -ldflags "-X github.com/FreifunkBremen/yanic/cmd.VERSION=$(git describe --tags)" -v -o yanic_${{ matrix.arch }}_${{ matrix.os }} + env: + GOOS: ${{ matrix.os }} + GOARCH: ${{ matrix.arch }} + CGO_ENABLED: 0 + - name: Archive build artifacts + uses: actions/upload-artifact@v2 + with: + name: build-${{ matrix.arch }}-${{ matrix.os }} + path: yanic_* diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d3b0e1d0..d026bd8b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,10 +1,9 @@ - name: Release + on: workflow_run: workflows: - - "Test, Lint" - - "Docs" + - "Golang" types: [ "completed" ] branches: - main @@ -12,6 +11,7 @@ on: permissions: contents: read # for checkout + attestations: read # for artifacts download jobs: release: @@ -38,6 +38,15 @@ jobs: - name: Verify the integrity of provenance attestations and registry signatures for installed dependencies run: npm audit signatures + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + pattern: build-* + path: build/ + merge-multiple: true + run-id: ${{ github.event.workflow_run.id }} + github-token: ${{ secrets.GITHUB_TOKEN }} + - name: Release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.releaserc b/.releaserc index 4bb9e614..9b97b9c2 100644 --- a/.releaserc +++ b/.releaserc @@ -22,7 +22,11 @@ ], [ "@semantic-release/github", - {} + { + "assets": [ + { "path": "build/yanic*" } + ] + } ] ] }