From 788b5eaf08655e761af50f6d5af920b02af14b7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Santamaria?= Date: Thu, 20 Jun 2024 21:11:58 +0200 Subject: [PATCH] Update workflow --- .github/workflows/build.yml | 69 +++++++++++++++++++++++-------------- .github/workflows/test.yml | 42 +++++++++++----------- 2 files changed, 64 insertions(+), 47 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d373817..cf68465 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - go-version: [1.22.x] + go-version: 1.22.x arch: [x86_64, aarch64] steps: @@ -39,6 +39,14 @@ jobs: name: tau-linux-${{ matrix.arch }} path: ./tau-linux-${{ matrix.arch }} + - name: Upload Linux artifact to release + uses: actions/upload-release-asset@v1 + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./tau-linux-${{ matrix.arch }} + asset_name: tau-linux-${{ matrix.arch }} + asset_content_type: application/octet-stream + # Build for Windows (only x86_64) build-windows: runs-on: ubuntu-latest @@ -69,13 +77,21 @@ jobs: name: tau-windows-x86_64 path: ./tau-windows-x86_64.exe + - name: Upload Windows artifact to release + uses: actions/upload-release-asset@v1 + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./tau-windows-x86_64.exe + asset_name: tau-windows-x86_64.exe + asset_content_type: application/octet-stream + # Build for MacOS build-macos: runs-on: macos-latest strategy: fail-fast: false matrix: - go-version: [1.21.x] + go-version: 1.22.x arch: [x86_64, aarch64] steps: @@ -93,27 +109,28 @@ jobs: 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 }} + - name: Upload MacOS artifact to release + uses: actions/upload-release-asset@v1 + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./tau-macos-${{ matrix.arch }} + asset_name: tau-macos-${{ matrix.arch }} + asset_content_type: application/octet-stream + + create_release: + runs-on: ubuntu-latest + needs: [build-linux, build-windows, build-macos] + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Create GitHub Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 442def1..f5a66d4 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