From 24654d7377af782f892baeba71ff5bb37eda244b Mon Sep 17 00:00:00 2001 From: Mostafa Moradian Date: Mon, 4 Dec 2023 02:12:15 +0100 Subject: [PATCH] Fix build pipeline --- .github/workflows/release.yaml | 53 ++-------------------------------- Makefile | 10 ++----- 2 files changed, 6 insertions(+), 57 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 1be03b5..38d309a 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -9,11 +9,8 @@ permissions: contents: write jobs: - build: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + build-and-release: + runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v3 @@ -25,54 +22,10 @@ jobs: go-version: "1.20" cache: true - name: Install dependencies - if: matrix.os == 'ubuntu-latest' run: sudo apt-get update && sudo apt-get install -y gcc-aarch64-linux-gnu - name: Build and release binaries - if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' - run: | - if [ "$RUNNER_OS" == "Linux" ]; then - make build-release-linux - elif [ "$RUNNER_OS" == "macOS" ]; then - make build-release-darwin - fi - - name: Build and release binaries - if: matrix.os == 'windows-latest' run: | - make build-release-windows - - name: Upload binaries and checksums - if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest' - uses: actions/upload-artifact@v3 - with: - path: dist/*.tar.gz - name: dist-${{ matrix.os }} - if-no-files-found: warn - - name: Upload binaries and checksums - if: matrix.os == 'windows-latest' - uses: actions/upload-artifact@v3 - with: - path: dist/*.zip - name: dist-${{ matrix.os }} - if-no-files-found: warn - release: - needs: build - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - name: Download binaries and checksums for Windows - uses: actions/download-artifact@v3 - with: - name: dist-windows-latest - - name: Download binaries and checksums for Linux - uses: actions/download-artifact@v3 - with: - name: dist-ubuntu-latest - - name: Download binaries and checksums for macOS - uses: actions/download-artifact@v3 - with: - name: dist-macos-latest + make build-release - name: Generate release checksums run: make generate-release-checksums - name: Create release and add artifacts diff --git a/Makefile b/Makefile index 05579f2..1e10d7e 100644 --- a/Makefile +++ b/Makefile @@ -79,16 +79,12 @@ build-windows-arm64: @zip -r dist/gatewayd-plugin-cache-windows-arm64-${VERSION}.zip -j ./dist/windows-arm64/ @sha256sum dist/gatewayd-plugin-cache-windows-arm64-${VERSION}.zip | sed 's/dist\///g' >> dist/checksums.txt -build-release-linux: tidy create-build-dir build-linux-amd64 build-linux-arm64 - -build-release-darwin: tidy create-build-dir build-darwin-amd64 build-darwin-arm64 - -build-release-windows: tidy create-build-dir build-windows-amd64 build-windows-arm64 +build-release: tidy create-build-dir build-linux-amd64 build-linux-arm64 build-darwin-amd64 build-darwin-arm64 build-windows-amd64 build-windows-arm64 generate-release-checksums: @sha256sum gatewayd-plugin-cache-linux-amd64-${VERSION}.tar.gz > checksums.txt @sha256sum gatewayd-plugin-cache-linux-arm64-${VERSION}.tar.gz >> checksums.txt @sha256sum gatewayd-plugin-cache-darwin-amd64-${VERSION}.tar.gz >> checksums.txt @sha256sum gatewayd-plugin-cache-darwin-arm64-${VERSION}.tar.gz >> checksums.txt - # @sha256sum gatewayd-plugin-cache-windows-amd64-${VERSION}.zip >> checksums.txt - # @sha256sum gatewayd-plugin-cache-windows-arm64-${VERSION}.zip >> checksums.txt + @sha256sum gatewayd-plugin-cache-windows-amd64-${VERSION}.zip >> checksums.txt + @sha256sum gatewayd-plugin-cache-windows-arm64-${VERSION}.zip >> checksums.txt