From 50b9d98e8a10257c7d796d532c0071edbc5f1ba2 Mon Sep 17 00:00:00 2001 From: Michael Feher Date: Tue, 3 Dec 2024 07:45:36 -0500 Subject: [PATCH] build: add delivery workflow --- .github/workflows/CD.yaml | 50 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/CD.yaml diff --git a/.github/workflows/CD.yaml b/.github/workflows/CD.yaml new file mode 100644 index 00000000..84b3babc --- /dev/null +++ b/.github/workflows/CD.yaml @@ -0,0 +1,50 @@ +name: Release + +on: + push: + branches: + - main + - beta +permissions: + contents: write + packages: write +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + goos: [ linux, darwin ] + goarch: [ amd64, arm64 ] + steps: + - uses: actions/checkout@v4 + - name: Install dependencies + run: go get . + - name: Build + env: + GOOS: ${{matrix.goos}} + GOARCH: ${{matrix.goarch}} + CGO_ENABLED: 0 + run: go build -o bin/algorun-${{matrix.goarch}}-${{matrix.goos}} *.go + - uses: actions/upload-artifact@master + with: + name: algorun-${{matrix.goarch}}-${{matrix.goos}} + path: bin/algorun-${{matrix.goarch}}-${{matrix.goos}} + release: + needs: + - build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 + with: + pattern: algorun* + path: ./bin + - uses: go-semantic-release/action@v1 + name: release + id: semver + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + - name: Upload Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gh release upload v${{steps.semver.outputs.version}} bin/**/* \ No newline at end of file