Skip to content

Build & Release

Build & Release #10

Workflow file for this run

name: Build & Release
run-name: Build & Release
on: push
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Check out smart-dns-updater
uses: actions/checkout@v4
- name: Test //...
run: |
bazelisk test --stamp --workspace_status_command=$PWD/status.sh //...
build:
strategy:
matrix:
goos: [linux, darwin]
goarch: [arm64, amd64]
runs-on: ubuntu-latest
needs: test
steps:
- name: Check out smart-dns-updater
uses: actions/checkout@v4
- name: Build for smart-dns-updater ${{ matrix.goos }}_${{ matrix.goarch }}
run: |
bazelisk build //:smart-dns-updater_${{ matrix.goos }}_${{ matrix.goarch }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: smart-dns-updater_${{ matrix.goos }}_${{ matrix.goarch }}
path: bazel-bin/smart-dns-updater_${{ matrix.goos }}_${{ matrix.goarch }}_/smart-dns-updater_${{ matrix.goos }}_${{ matrix.goarch }}
if-no-files-found: error
release:
runs-on: ubuntu-latest
needs: [build, test]
steps:
- name: Dowload artifacts
uses: actions/download-artifact@v4
with:
pattern: smart-dns-updater_*
- name: Release
uses: softprops/action-gh-release@v2
# Only release on tags
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
${{ github.workspace }}/smart-dns-updater_*