Skip to content

Commit

Permalink
Merge pull request #70 from gatewayd-io/fix-build-pipeline
Browse files Browse the repository at this point in the history
Fix build pipeline
  • Loading branch information
mostafa authored Dec 4, 2023
2 parents 9bda57a + 24654d7 commit ada5e6d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 57 deletions.
53 changes: 3 additions & 50 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
10 changes: 3 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit ada5e6d

Please sign in to comment.