From 5c608cec7531a22a1a09b181ab0f8f8cacec2b16 Mon Sep 17 00:00:00 2001 From: Chief Marlin <96321026+chiefMarlin@users.noreply.github.com> Date: Fri, 27 Sep 2024 14:30:57 -0400 Subject: [PATCH] Update build.yml --- .github/workflows/build.yml | 93 ++++++++++++++++++++++++++++++++----- 1 file changed, 82 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bd098d4..5babb45 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,39 +11,110 @@ jobs: RELEASE_NAME: Latest release RELEASE_BODY: Latest release GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - BINARY_PREFIX: ${{ github.event.repository.name }} + BINARY_PREFIX: releaseMaker + SOURCE_PATH: . steps: - name: Checkout the repository uses: actions/checkout@v2 - - name: Set up Go uses: actions/setup-go@v2 with: go-version: '*' # Use the latest stable version of Go - - name: Install dependencies run: go mod download - - name: Download releaseMaker run: wget https://github.com/8ff/releaseMaker/releases/download/latest/releaseMaker.linux.amd64 -O /tmp/releaseMaker && chmod +x /tmp/releaseMaker - name: Build Darwin ARM64 binary - run: GOOS=darwin GOARCH=arm64 go build -ldflags "-X 'main.Version=$(date +'%Y-%m-%d_%H:%M:%S')'" -o "/tmp/build/${{ env.BINARY_PREFIX }}.darwin.arm64" + working-directory: ${{ env.SOURCE_PATH }} + env: + OS: darwin + ARCH: arm64 + run: GOOS=$OS GOARCH=$ARCH go build -ldflags "-X 'main.Version=$(date +'%Y-%m-%d_%H:%M:%S')'" -o "/tmp/build/${{ env.BINARY_PREFIX }}.$OS.$ARCH" - name: Build Darwin AMD64 binary - run: GOOS=darwin GOARCH=amd64 go build -ldflags "-X 'main.Version=$(date +'%Y-%m-%d_%H:%M:%S')'" -o "/tmp/build/${{ env.BINARY_PREFIX }}.darwin.amd64" + working-directory: ${{ env.SOURCE_PATH }} + env: + OS: darwin + ARCH: amd64 + run: GOOS=$OS GOARCH=$ARCH go build -ldflags "-X 'main.Version=$(date +'%Y-%m-%d_%H:%M:%S')'" -o "/tmp/build/${{ env.BINARY_PREFIX }}.$OS.$ARCH" - name: Build Linux ARM64 binary - run: GOOS=linux GOARCH=arm64 go build -ldflags "-X 'main.Version=$(date +'%Y-%m-%d_%H:%M:%S')'" -o "/tmp/build/${{ env.BINARY_PREFIX }}.linux.arm64" + working-directory: ${{ env.SOURCE_PATH }} + env: + OS: linux + ARCH: arm64 + run: GOOS=$OS GOARCH=$ARCH go build -ldflags "-X 'main.Version=$(date +'%Y-%m-%d_%H:%M:%S')'" -o "/tmp/build/${{ env.BINARY_PREFIX }}.$OS.$ARCH" - name: Build Linux AMD64 binary - run: GOOS=linux GOARCH=amd64 go build -ldflags "-X 'main.Version=$(date +'%Y-%m-%d_%H:%M:%S')'" -o "/tmp/build/${{ env.BINARY_PREFIX }}.linux.amd64" + working-directory: ${{ env.SOURCE_PATH }} + env: + OS: linux + ARCH: amd64 + run: GOOS=$OS GOARCH=$ARCH go build -ldflags "-X 'main.Version=$(date +'%Y-%m-%d_%H:%M:%S')'" -o "/tmp/build/${{ env.BINARY_PREFIX }}.$OS.$ARCH" - name: Build Windows AMD64 binary - run: GOOS=windows GOARCH=amd64 go build -ldflags "-X 'main.Version=$(date +'%Y-%m-%d_%H:%M:%S')'" -o "/tmp/build/${{ env.BINARY_PREFIX }}.windows.amd64.exe" + working-directory: ${{ env.SOURCE_PATH }} + env: + OS: windows + ARCH: amd64 + run: GOOS=$OS GOARCH=$ARCH go build -ldflags "-X 'main.Version=$(date +'%Y-%m-%d_%H:%M:%S')'" -o "/tmp/build/${{ env.BINARY_PREFIX }}.$OS.$ARCH.exe" - name: Build Windows ARM64 binary - run: GOOS=windows GOARCH=amd64 go build -ldflags "-X 'main.Version=$(date +'%Y-%m-%d_%H:%M:%S')'" -o "/tmp/build/${{ env.BINARY_PREFIX }}.windows.arm64.exe" + working-directory: ${{ env.SOURCE_PATH }} + env: + OS: windows + ARCH: arm64 + run: GOOS=$OS GOARCH=$ARCH go build -ldflags "-X 'main.Version=$(date +'%Y-%m-%d_%H:%M:%S')'" -o "/tmp/build/${{ env.BINARY_PREFIX }}.$OS.$ARCH.exe" + + - name: Build OpenBSD AMD64 binary + working-directory: ${{ env.SOURCE_PATH }} + env: + OS: openbsd + ARCH: amd64 + run: GOOS=$OS GOARCH=$ARCH go build -ldflags "-X 'main.Version=$(date +'%Y-%m-%d_%H:%M:%S')'" -o "/tmp/build/${{ env.BINARY_PREFIX }}.$OS.$ARCH" + + - name: Build OpenBSD ARM64 binary + working-directory: ${{ env.SOURCE_PATH }} + env: + OS: openbsd + ARCH: arm64 + run: GOOS=$OS GOARCH=$ARCH go build -ldflags "-X 'main.Version=$(date +'%Y-%m-%d_%H:%M:%S')'" -o "/tmp/build/${{ env.BINARY_PREFIX }}.$OS.$ARCH" + + - name: Build FreeBSD AMD64 binary + working-directory: ${{ env.SOURCE_PATH }} + env: + OS: freebsd + ARCH: amd64 + run: GOOS=$OS GOARCH=$ARCH go build -ldflags "-X 'main.Version=$(date +'%Y-%m-%d_%H:%M:%S')'" -o "/tmp/build/${{ env.BINARY_PREFIX }}.$OS.$ARCH" + + - name: Build FreeBSD ARM64 binary + working-directory: ${{ env.SOURCE_PATH }} + env: + OS: freebsd + ARCH: arm64 + run: GOOS=$OS GOARCH=$ARCH go build -ldflags "-X 'main.Version=$(date +'%Y-%m-%d_%H:%M:%S')'" -o "/tmp/build/${{ env.BINARY_PREFIX }}.$OS.$ARCH" + + - name: Build NetBSD AMD64 binary + working-directory: ${{ env.SOURCE_PATH }} + env: + OS: netbsd + ARCH: amd64 + run: GOOS=$OS GOARCH=$ARCH go build -ldflags "-X 'main.Version=$(date +'%Y-%m-%d_%H:%M:%S')'" -o "/tmp/build/${{ env.BINARY_PREFIX }}.$OS.$ARCH" + + - name: Build NetBSD ARM64 binary + working-directory: ${{ env.SOURCE_PATH }} + env: + OS: netbsd + ARCH: arm64 + run: GOOS=$OS GOARCH=$ARCH go build -ldflags "-X 'main.Version=$(date +'%Y-%m-%d_%H:%M:%S')'" -o "/tmp/build/${{ env.BINARY_PREFIX }}.$OS.$ARCH" + + - name: Build DragonFly BSD AMD64 binary + working-directory: ${{ env.SOURCE_PATH }} + env: + OS: dragonfly + ARCH: amd64 + run: GOOS=$OS GOARCH=$ARCH go build -ldflags "-X 'main.Version=$(date +'%Y-%m-%d_%H:%M:%S')'" -o "/tmp/build/${{ env.BINARY_PREFIX }}.$OS.$ARCH" - name: Replace Existing Release run: /tmp/releaseMaker replace ${{ github.repository }} ${{ env.TAG }} "${{ env.RELEASE_NAME }}" "${{ env.RELEASE_BODY }}" @@ -53,4 +124,4 @@ jobs: cd /tmp/build for file in *; do /tmp/releaseMaker upload ${{ github.repository }} ${{ env.TAG }} $file $file - done \ No newline at end of file + done