Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build pipeline #70

Merged
merged 1 commit into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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