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

Implemented GitHub Actions workflow for automated binary file building. #433

Merged
merged 1 commit into from
Oct 10, 2022
Merged
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
94 changes: 94 additions & 0 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# NOTE: multiple `make` commands could be replaced with
# `make release` in future if all binaries are built on MacOS machine

name: Build Release binaries

on:
# Workflow executes when a new release is created
release:
types: [created]

jobs:
# most binaries can be built on linux machine which is the most cost-efficient on GitHub actions
# for building darwin-arm64 binary we need Xcode, therefore, we need to build it on MacOS

linux-build:
name: Build binaries on Ubuntu
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Run Makefile
run: |
make package
make linux
make linux-arm64
make windows
make windows32

# Artifacts docs: https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts
- name: Upload files as artifact
uses: actions/upload-artifact@v3
synfinatic marked this conversation as resolved.
Show resolved Hide resolved
with:
name: ubuntu-build-files
path: dist/aws-sso*
retention-days: 1

macos-build:
name: Build binaries on MacOS
runs-on: macos-latest

steps:
- uses: actions/checkout@v3

- name: Run Makefile
run: |
make darwin-arm64
synfinatic marked this conversation as resolved.
Show resolved Hide resolved
make darwin

- name: Upload files as artifact
uses: actions/upload-artifact@v3
with:
name: macos-build-files
path: dist/aws-sso*
retention-days: 1

sign-and-upload-files:
name: Sign and upload binary files
runs-on: ubuntu-latest

# Wait for binary files to be built
needs: [linux-build, macos-build]

steps:
- name: Download ubuntu binaries
uses: actions/download-artifact@v3
with:
name: ubuntu-build-files
path: dist/

- name: Download macos binaries
uses: actions/download-artifact@v3
with:
name: macos-build-files
path: dist/

# Source: https://github.com/crazy-max/ghaction-import-gpg
- name: Import GPG key
uses: crazy-max/[email protected]
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}

- name: Create signature file
run: |
shasum -a 256 dist/* | gpg --clear-sign > dist/release.sig.asc

# Source: https://github.com/svenstaro/upload-release-action
- name: Upload all files to release
uses: svenstaro/upload-release-action@v2
with:
file: dist/*
overwrite: true
file_glob: true