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

workflow: Create workflow manifest for compiling mistserver #16

Merged
merged 6 commits into from
Apr 8, 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
162 changes: 162 additions & 0 deletions .github/workflows/mistserver.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
name: Build and release mist server binaries

on:
push:
branches:
- "main"
tags:
- "mist-v*"

jobs:
linux:
name: Build mist binaries for linux platform
runs-on: ubuntu-20.04
steps:
- name: Check out code
uses: actions/checkout@v3
with:
path: 'livepeer-in-a-box'
fetch-depth: 0
# Check https://github.com/livepeer/go-livepeer/pull/1891
# for ref value discussion
ref: ${{ github.event.pull_request.head.sha }}

- name: Check out mistserver code
uses: actions/checkout@v3
with:
repository: DDVTECH/mistserver
path: 'mistserver'
fetch-depth: 0
ref: livepeer-in-a-box

- name: Restore build cache
uses: actions/cache@v3
with:
path: |
livepeer-in-a-box/build
key: ${{ runner.os }}-build-${{ hashFiles('**/Makefile') }}
restore-keys: |
${{ runner.os }}-build-

- name: Compile mist binaries
shell: bash
run: |
cd livepeer-in-a-box/
mkdir -p releases/ build/ bin/
make mistserver
cd bin/
tar -czvf "../releases/livepeer-mistserver-linux-amd64.tar.gz" ./*

- name: Upload mist binaries as build artifacts
uses: actions/upload-artifact@master
with:
name: release-artifacts
path: livepeer-in-a-box/releases/

macos:
name: Build mist binaries for macOS platform
runs-on: macos-11
steps:
- name: Check out code
uses: actions/checkout@v3
with:
path: 'livepeer-in-a-box'
fetch-depth: 0
# Check https://github.com/livepeer/go-livepeer/pull/1891
# for ref value discussion
ref: ${{ github.event.pull_request.head.sha }}

- name: Check out mistserver code
uses: actions/checkout@v3
with:
repository: DDVTECH/mistserver
path: 'mistserver'
fetch-depth: 0
ref: livepeer-in-a-box

- name: Restore build cache
uses: actions/cache@v3
with:
path: |
livepeer-in-a-box/build
key: ${{ runner.os }}-build-${{ hashFiles('**/Makefile') }}
restore-keys: |
${{ runner.os }}-build-

- name: Compile mist binaries
shell: bash
run: |
command -v brew && brew install coreutils
cd livepeer-in-a-box/
mkdir -p releases/ build/ bin/
make mistserver
cd bin/
tar -czvf "../releases/livepeer-mistserver-darwin-amd64.tar.gz" ./*

- uses: actions-ecosystem/action-regex-match@v2
id: match-tag
with:
text: ${{ github.ref_name }}
regex: '^(master|main|mist-v[0-9]+\.\d+\.\d+)$'

- name: Codesign and notarize binaries
if: ${{ steps.match-tag.outputs.match != '' }}
uses: livepeer/action-gh-codesign-apple@latest
with:
developer-certificate-id: ${{ secrets.CI_MACOS_CERTIFICATE_ID }}
developer-certificate-base64: ${{ secrets.CI_MACOS_CERTIFICATE_BASE64 }}
developer-certificate-password: ${{ secrets.CI_MACOS_CERTIFICATE_PASSWORD }}
app-notarization-email: ${{ secrets.CI_MACOS_NOTARIZATION_USER }}
app-notarization-password: ${{ secrets.CI_MACOS_NOTARIZATION_PASSWORD }}
binary-path: "livepeer-in-a-box/bin/"
app-bundle-id: "org.livepeer.mistserver"

- name: Upload mist binaries as build artifacts
uses: actions/upload-artifact@master
with:
name: release-artifacts
path: livepeer-in-a-box/releases/

release:
name: Create release for mist binaries
runs-on: ubuntu-20.04
needs:
- linux
- macos
steps:
- name: checkout
uses: actions/checkout@master
with:
fetch-depth: 0
ref: ${{ github.event.workflow_run.head_branch }}

- uses: actions-ecosystem/action-regex-match@v2
id: match-tag
with:
text: ${{ github.ref_name }}
regex: '^mist-v([0-9]+\.\d+\.\d+)$'

- name: Download artifacts from build stages
if: ${{ steps.match-tag.outputs.match != '' }}
uses: actions/download-artifact@v3
with:
name: release-artifacts
path: releases/

- name: Generate sha256 checksum and gpg signatures for release artifacts
if: ${{ steps.match-tag.outputs.match != '' }}
uses: livepeer/action-gh-checksum-and-gpg-sign@latest
with:
artifacts-dir: releases
release-name: ${{ github.ref_name }}
gpg-key: ${{ secrets.CI_GPG_SIGNING_KEY }}
gpg-key-passphrase: ${{ secrets.CI_GPG_SIGNING_PASSPHRASE }}

- name: Release to github
uses: softprops/action-gh-release@v1
if: ${{ steps.match-tag.outputs.match != '' }}
with:
generate_release_notes: true
tag_name: ${{ github.event.workflow_run.head_branch }}
files: |
releases/*