Skip to content

Commit

Permalink
ci: use shared build workflow for building (again)
Browse files Browse the repository at this point in the history
  • Loading branch information
Siroshun09 committed Jul 27, 2024
1 parent 8402a1d commit b014638
Showing 1 changed file with 21 additions and 28 deletions.
49 changes: 21 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,24 @@ name: Go Build
on: [push, pull_request]

jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: "Checkout"
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- name: "Set up Go"
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version-file: go.mod
cache: true
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@286f3b13b1b49da4ac219696163fb8c1c93e1200 # v6.0.0
with:
distribution: goreleaser
version: latest
args: build --snapshot --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload artifacts
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
with:
name: artifacts-${{ matrix.os }}
path: dist
build-ubuntu:
uses: Siroshun09/gh-actions-workflows/.github/workflows/go-build.yml@v1
with:
os: ubuntu-latest
package-name: dljdk-${{ github.run_number }}
go-filepath: "./cmd/dljdk/main.go"
output-filepath: "dist/dljdk"
build-macos:
uses: Siroshun09/gh-actions-workflows/.github/workflows/go-build.yml@v1
with:
os: macos-latest
package-name: dljdk-${{ github.run_number }}
go-filepath: "./cmd/dljdk/main.go"
output-filepath: "dist/dljdk"
build-windows:
uses: Siroshun09/gh-actions-workflows/.github/workflows/go-build.yml@v1
with:
os: windows-latest
package-name: dljdk-${{ github.run_number }}
go-filepath: "./cmd/dljdk/main.go"
output-filepath: "dist/dljdk.exe"

0 comments on commit b014638

Please sign in to comment.