build x86_64 on ubuntu latest and arm64 on RPi #2519
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: go-core build | ||
on: push | ||
jobs: | ||
build-windows: | ||
runs-on: windows-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.23 | ||
- name: Setup MSYS | ||
uses: msys2/setup-msys2@v2 | ||
with: | ||
msystem: mingw64 | ||
update: true | ||
install: > | ||
git | ||
base-devel | ||
autoconf-wrapper | ||
autoconf | ||
automake | ||
libtool | ||
mingw-w64-x86_64-toolchain | ||
mingw-w64-x86_64-go | ||
- name: Build Windows | ||
run: | | ||
make gocore | ||
make test | ||
- name: Upload Gocore | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: gocore-windows-x86_64 | ||
path: ./build/bin/gocore* | ||
build: | ||
runs-on: ${{ matrix.config.os }} | ||
strategy: | ||
matrix: | ||
config: | ||
- {platform: macos-14, os: darwin, arch: amd64, path: darwin-x86_64} | ||
- {platform: macos-latest, os: dawin, arch: arm64, path: darwin-arm64} | ||
- {platform: ubuntu-latest, os: linux, arch: amd64, path: linux-x86_64} | ||
- {platform: raspbian-private, os: linux, arch: arm64, path: linux-arm64} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: 1.23 | ||
- name: Build & Test | ||
run: | | ||
uname -m | ||
export GOOS=${{ matrix.config.os }} | ||
export GOARCH=${{ matrix.config.arch }} | ||
make gocore | ||
make test | ||
- name: Upload Gocore | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: gocore-${{ matrix.config.path }} | ||
path: ./build/bin/gocore* | ||
release: | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
needs: [build-windows, build-mac, build-alpine] | ||
Check failure on line 70 in .github/workflows/build.yml GitHub Actions / go-core buildInvalid workflow file
|
||
runs-on: ubuntu-latest | ||
outputs: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Version | ||
id: version | ||
run: echo ::set-output name=tag::$(echo ${GITHUB_REF:10}) | ||
- name: Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ steps.version.outputs.tag }} | ||
release_name: ${{ steps.version.outputs.tag }} gocore release | ||
draft: false | ||
prerelease: true | ||
artifacts: | ||
needs: release | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
platform: [ | ||
{path: linux-x86_64, file_ext: ""}, | ||
{path: windows-x86_64, file_ext: ".exe"}, | ||
{path: linux-aarch64, file_ext: ""}, | ||
{path: linux-riscv64, file_ext: ""}, | ||
{path: darwin-x86_64, file_ext: ""}, | ||
{path: darwin-arm64, file_ext: ""}, | ||
] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Artifact Gocore | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: gocore-${{ matrix.platform.path}} | ||
path: ./gocore-${{ matrix.platform.path }} | ||
- name: Upload Gocore release assets | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ needs.release.outputs.upload_url }} | ||
asset_path: ./gocore-${{ matrix.platform.path }}/gocore${{matrix.platform.file_ext}} | ||
asset_name: gocore-${{ matrix.platform.path }}${{matrix.platform.file_ext}} | ||
asset_content_type: application/octet-stream | ||
- name: Generate gocore checksums | ||
working-directory: ./gocore-${{ matrix.platform.path }} | ||
run: | | ||
mv ./gocore${{matrix.platform.file_ext}} ./gocore-${{ matrix.platform.path }}${{matrix.platform.file_ext}} | ||
sha256sum gocore-${{ matrix.platform.path }}${{matrix.platform.file_ext}} >gocore-${{ matrix.platform.path }}${{matrix.platform.file_ext}}.checksum | ||
- name: Upload Gocore release assets checksums (Linux and Mac) | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ needs.release.outputs.upload_url }} | ||
asset_path: ./gocore-${{ matrix.platform.path }}/gocore-${{ matrix.platform.path }}${{matrix.platform.file_ext}}.checksum | ||
asset_name: gocore-${{ matrix.platform.path }}${{matrix.platform.file_ext}}.checksum | ||
asset_content_type: text/plain |