diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6228b01..55ada88 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,51 +5,52 @@ jobs: if: startsWith(github.ref, 'refs/heads/main') runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 - with: - go-version: '^1.13.1' - - name: go test - run: go test -v ./... + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 + with: + go-version: "^1.19.1" + - name: go test + run: go test -v ./... test_build_release: if: startsWith(github.ref, 'refs/tags/') runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-go@v2 - with: - go-version: '^1.13.1' - - name: Get the version - id: get_tag - run: echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/} - - name: go test - run: go test -v ./... - - name: build - shell: bash - run: | - # Make an artifacts directory - mkdir -p artifacts - - # run the build for each supported OS - for os in "linux" "darwin" "windows"; do - echo "Building for $os..." - GOOS=$os CGO_ENABLED=0 go build -a -ldflags="-X main.version=${{ steps.get_tag.outputs.SOURCE_TAG }}" -o ./artifacts/launch_${os} . - - # If its windows we need to rename it to have .exe at the end. - if [ $os == "windows" ]; then - mv ./artifacts/launch_$os ./artifacts/launch_$os.exe - fi - done - # Make an Arm bin for linux also - for arch in arm64 arm; do - echo "Building for linux on $arch..." - GOOS=linux GOARCH=$arch CGO_ENABLED=0 go build -a -ldflags="-X main.version=${{ steps.get_tag.outputs.SOURCE_TAG }}" -o ./artifacts/launch_linux_${arch} . - done + - uses: actions/checkout@v3 + - uses: actions/setup-go@v4 + with: + go-version: "^1.19.1" + - name: Get the version + id: get_tag + run: echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags/} + - name: go test + run: go test -v ./... + - name: build + shell: bash + run: | + # Make an artifacts directory + mkdir -p artifacts - - name: Release - uses: softprops/action-gh-release@v1 - with: - files: artifacts/* - body_path: .github/workflows/release_body.md - env: - GITHUB_TOKEN: ${{ github.token }} \ No newline at end of file + # Run the build for each supported OS using x86_64. + # Building for windows. + echo "Building for Windows on amd64..." + GOOS=$os GOARCH=amd64 CGO_ENABLED=0 go build -a -ldflags="-X main.version=${{ steps.get_tag.outputs.SOURCE_TAG }}" -o ./artifacts/launch_windows.exe . + + # Make an ARM and ARM64 bin for linux and Mac. + for os in "linux" "darwin"; do + for arch in "amd64" "arm64" "arm"; do + echo "Building for $os on $arch..." + if [ "$os" = "darwin" ] && [ "$arch" = "arm" ]; then + echo "Skipping $os on $arch..." + continue + fi + GOOS=$os GOARCH=$arch CGO_ENABLED=0 go build -a -ldflags="-X main.version=${{ steps.get_tag.outputs.SOURCE_TAG }}" -o ./artifacts/launch_${os}_${arch} . + done + done + + - name: Release + uses: softprops/action-gh-release@v1 + with: + files: artifacts/* + body_path: .github/workflows/release_body.md + env: + GITHUB_TOKEN: ${{ github.token }} diff --git a/.github/workflows/release_body.md b/.github/workflows/release_body.md index cad992b..cce870b 100644 --- a/.github/workflows/release_body.md +++ b/.github/workflows/release_body.md @@ -1,4 +1,3 @@ -# Bug fix and Github work flows +# Adding in more supported CPU architectures -Fixed a bug where processes set to have a start delay did not delay. -Adding in Github work flow. \ No newline at end of file +This can now be used on arm64 chips. This enables use on apple silicon and other arm64 chips. \ No newline at end of file