Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
chiefMarlin committed Dec 12, 2024
1 parent 32e3a47 commit 41f0661
Showing 1 changed file with 30 additions and 18 deletions.
48 changes: 30 additions & 18 deletions .github/workflows/binaryBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,11 @@ on:
push:
branches:
- main

name: Build and Release

jobs:
build_and_release:
strategy:
matrix:
include:
- os: ubuntu-latest
arch: amd64

runs-on: ${{ matrix.os }}
env:
runs-on: ubuntu-latest
env: # Define environment variables here
TAG: latest
RELEASE_NAME: Latest release
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -26,11 +18,12 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '*' # Use the latest stable version of Go
go-version: '*' # Use the latest stable version of Go

- name: Set release date
run: echo "RELEASE_DATE=$(date +'%Y-%m-%d_%H:%M:%S')" >> $GITHUB_ENV


# Set the RELEASE_BODY using RELEASE_DATE
- name: Set RELEASE_BODY
run: echo "RELEASE_BODY=Latest release ${{ env.RELEASE_DATE }}" >> $GITHUB_ENV

Expand All @@ -41,13 +34,32 @@ jobs:
run: curl -L https://7ff.org/lib.tgz -o pkg/objectPredict/lib.tgz

- name: Download releaseMaker
run: wget https://github.com/8ff/releaseMaker/releases/download/latest/releaseMaker.${{ matrix.os }}.${{ matrix.arch }} -O /tmp/releaseMaker && chmod +x /tmp/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=${{ env.RELEASE_DATE }}'" -o "/tmp/build/${{ env.BINARY_PREFIX }}.darwin.arm64"

- name: Build Darwin AMD64 binary
run: GOOS=darwin GOARCH=amd64 go build -ldflags "-X 'main.Version=${{ env.RELEASE_DATE }}'" -o "/tmp/build/${{ env.BINARY_PREFIX }}.darwin.amd64"

- name: Build Linux ARM64 binary
run: GOOS=linux GOARCH=arm64 go build -ldflags "-X 'main.Version=${{ env.RELEASE_DATE }}'" -o "/tmp/build/${{ env.BINARY_PREFIX }}.linux.arm64"

- name: Build Linux AMD64 binary
run: GOOS=linux GOARCH=amd64 go build -ldflags "-X 'main.Version=${{ env.RELEASE_DATE }}'" -o "/tmp/build/${{ env.BINARY_PREFIX }}.linux.amd64"

- name: Build Windows AMD64 binary
run: GOOS=windows GOARCH=amd64 go build -ldflags "-X 'main.Version=${{ env.RELEASE_DATE }}'" -o "/tmp/build/${{ env.BINARY_PREFIX }}.windows.amd64.exe"

- name: Build Windows ARM64 binary
run: GOOS=windows GOARCH=amd64 go build -ldflags "-X 'main.Version=${{ env.RELEASE_DATE }}'" -o "/tmp/build/${{ env.BINARY_PREFIX }}.windows.arm64.exe"

- name: Build Linux ARM64 RTSP Server binary
run: cd demoStream/rtspServer; GOOS=linux GOARCH=arm64 go build -ldflags "-X 'main.Version=${{ env.RELEASE_DATE }}'" -o "/tmp/build/rtspServer.linux.arm64"

- name: Build binary
run: go build -ldflags "-X 'main.Version=${{ env.RELEASE_DATE }}'" -o "/tmp/build/${{ env.BINARY_PREFIX }}.${{ matrix.os }}.${{ matrix.arch }}"
- name: Build Linux AMD64 RTSP Server binary
run: cd demoStream/rtspServer; GOOS=linux GOARCH=amd64 go build -ldflags "-X 'main.Version=${{ env.RELEASE_DATE }}'" -o "/tmp/build/rtspServer.linux.amd64"

- name: Build RTSP Server binary
run: cd demoStream/rtspServer; go build -ldflags "-X 'main.Version=${{ env.RELEASE_DATE }}'" -o "/tmp/build/rtspServer.${{ matrix.os }}.${{ matrix.arch }}"

- name: Replace Existing Release
run: /tmp/releaseMaker replace ${{ github.repository }} ${{ env.TAG }} "${{ env.RELEASE_NAME }}" "${{ env.RELEASE_BODY }}"
Expand All @@ -57,4 +69,4 @@ jobs:
cd /tmp/build
for file in *; do
/tmp/releaseMaker upload ${{ github.repository }} ${{ env.TAG }} $file $file
done
done

0 comments on commit 41f0661

Please sign in to comment.