diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..54b3e5b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,119 @@ +--- +# on: +# push: +# tags: +# - "v*" + +on: [push] + +name: Build + +jobs: + # Build for Linux (both x86_64 and aarch64) + build-linux: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + go-version: [1.22.x] + arch: [x86_64, aarch64] + + steps: + - name: Setup Go + uses: actions/setup-go@v3 + with: + go-version: ${{ matrix.go-version }} + + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Initialize and update submodules + run: git submodule init && git submodule update + + - name: Build for Linux + run: make && mv tau tau-linux-${{ matrix.arch }} + + - name: Archive Linux artifact + uses: actions/upload-artifact@v3 + with: + name: tau-linux-${{ matrix.arch }} + path: ./tau-linux-${{ matrix.arch }} + + # Build for Windows (only x86_64) + build-windows: + runs-on: ubuntu-latest + strategy: + fail-fast: false + + steps: + - name: Setup Go + uses: actions/setup-go@v3 + with: + go-version: 1.22.x + + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install MinGW + run: sudo apt install mingw-w64 -y + + - name: Initialize and update submodules + run: git submodule init && git submodule update + + - name: Build for Windows x86_64 + run: make windows && mv tau.exe tau-windows-x86_64.exe + + - name: Archive Windows artifact + uses: actions/upload-artifact@v3 + with: + name: tau-windows-x86_64 + path: ./tau-windows-x86_64.exe + + # Build for MacOS + build-macos: + runs-on: macos-latest + strategy: + fail-fast: false + matrix: + go-version: [1.21.x] + arch: [x86_64, aarch64] + + steps: + - name: Build MacOS + uses: actions/setup-go@v3 + with: + go-version: ${{ matrix.go-version }} + - uses: actions/checkout@v4 + - run: git submodule init && git submodule update + - run: brew install make automake libtool texinfo autoconf + - run: make && mv tau tau-macos-${{ matrix.arch }} + - name: Archive artifacts + uses: actions/upload-artifact@v3 + with: + name: tau-macos-${{ matrix.arch }} + path: ./tau-macos-${{ matrix.arch }} + + # Build for Linux + # build-ubuntu: + # runs-on: ubuntu-latest + # strategy: + # fail-fast: false + # matrix: + # go-version: [1.22.x] + # arch: [x86_64, aarch64] + + # steps: + # - name: Build GNU/Linux + # uses: actions/setup-go@v3 + # with: + # go-version: ${{ matrix.go-version }} + # - uses: actions/checkout@v4 + # - run: apt install mingw-w64 + # - run: git submodule init && git submodule update + # - run: make && mv tau tau-linux-${{ matrix.arch }} + # - run: make windows && mv tau.exe tau-windows-${{ matrix.arch }}.exe + # - name: Archive artifacts + # uses: actions/upload-artifact@v3 + # with: + # name: tau-linux-${{ matrix.arch }} + # path: ./tau-linux-${{ matrix.arch }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 96c9b9d..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,73 +0,0 @@ -name: Build and Release - -# on: -# push: -# tags: -# - 'v*' - -on: - push: - branches: - - '*' - pull_request: - branches: - - '*' - -jobs: - build: - runs-on: ubuntu-latest - - env: - DIR: ${{ github.workspace }} - CFLAGS: -g -Ofast -I${{ github.workspace }}/internal/obj/libffi/include - LDFLAGS: -L${{ github.workspace }}/internal/obj/libffi/lib ${{ github.workspace }}/internal/obj/libffi/lib/libffi.a -lm - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up Go - uses: actions/setup-go@v2 - with: - go-version: '1.22' - - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install -y build-essential autoconf automake libtool pkg-config gettext mingw-w64 mingw-w64-tools - - - name: Build for Linux - run: | - make all - - - name: Build for Windows - run: | - sudo apt-get install -y gcc-mingw-w64-x86-64 - make windows - - - name: Create release directory - run: | - mkdir -p release - - - name: Move artifacts - run: | - cp tau release/tau-linux-amd64 - cp tau.exe release/tau-windows-amd64.exe - - - name: Upload Release Assets - uses: actions/upload-release-asset@v1 - if: startsWith(github.ref, 'refs/tags/') - with: - upload_url: ${{ github.event.release.upload_url }} - asset_path: release/tau-linux-amd64 - asset_name: tau-linux-amd64 - asset_content_type: application/octet-stream - - - name: Upload Release Assets for Windows - uses: actions/upload-release-asset@v1 - if: startsWith(github.ref, 'refs/tags/') - with: - upload_url: ${{ github.event.release.upload_url }} - asset_path: release/tau-windows-amd64.exe - asset_name: tau-windows-amd64.exe - asset_content_type: application/octet-stream \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f5a66d4..442def1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,21 +1,21 @@ ---- -on: [push, pull_request] -name: Test -jobs: - test: - strategy: - matrix: - go-version: [1.21.x, 1.19.x] - os: [ubuntu-latest, macos-latest] - runs-on: ${{ matrix.os }} - steps: - - uses: actions/setup-go@v3 - with: - go-version: ${{ matrix.go-version }} - - uses: actions/checkout@v3 - - run: git submodule init && git submodule update - - name: Install automake on macOS - if: runner.os == 'macOS' - run: brew install automake - - run: make libffi - - run: make test +# --- +# on: [push, pull_request] +# name: Test +# jobs: +# test: +# strategy: +# matrix: +# go-version: [1.21.x, 1.19.x] +# os: [ubuntu-latest, macos-latest] +# runs-on: ${{ matrix.os }} +# steps: +# - uses: actions/setup-go@v3 +# with: +# go-version: ${{ matrix.go-version }} +# - uses: actions/checkout@v3 +# - run: git submodule init && git submodule update +# - name: Install automake on macOS +# if: runner.os == 'macOS' +# run: brew install automake +# - run: make libffi +# - run: make test