Skip to content

Change sig to have a header instead of a footer. This breaks the exis… #7

Change sig to have a header instead of a footer. This breaks the exis…

Change sig to have a header instead of a footer. This breaks the exis… #7

Workflow file for this run

on:
push:
tags: 'v*'
jobs:
create-release:
name: Create Release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Set Env
run: |
echo "RELEASE_NAME=${GITHUB_REF_NAME}" >> ${GITHUB_ENV}
- name: Create Release
run: gh release create "${GITHUB_REF_NAME}" --title "${{ env.RELEASE_NAME }}" --generate-notes --draft
env:
GITHUB_TOKEN: ${{ github.TOKEN }}
build-exchange:
name: Build Exchange
needs: [create-release]
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: ./exchange
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Setup
run: |
mkdir sig
curl -s "$(curl -s https://api.github.com/repos/claytonsingh/tools/releases/latest | jq -r '.assets[] | select(.name == "sig.tar.gz") | .browser_download_url')" -L -o- | tar -xzv -C sig
- name: Build
run: |
mkdir bin
gcc exchange.c -s -Os -o exchange
- name: Package
run: |
tar -czv -O -C bin . > exchange.tar.gz
sig/sig-linux-x64 sign --if exchange.tar.gz --of exchange.tar.sig.gz <(printenv SIG_KEY)
env:
SIG_KEY: ${{ secrets.SIG_KEY }}
- name: Upload Release
run: |
gh release upload "${GITHUB_REF_NAME}" exchange.tar.gz exchange.tar.sig.gz
env:
GITHUB_TOKEN: ${{ github.TOKEN }}
build-sig:
name: Build Sig
needs: [create-release]
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: ./sig
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '>=1.20'
- name: Build
run: |
mkdir bin
go get .
GOOS=linux GOARCH=arm64 go build -o bin/sig-linux-arm64 .
GOOS=linux GOARCH=amd64 go build -o bin/sig-linux-x64 .
GOOS=linux GOARCH=riscv64 go build -o bin/sig-linux-riscv64 .
GOOS=windows GOARCH=arm64 go build -o bin/sig-windows-arm64.exe .
GOOS=windows GOARCH=amd64 go build -o bin/sig-windows-x64.exe .
- name: Test
run: go test
- name: Package
run: |
tar -czv -O -C bin . > sig.tar.gz
bin/sig-linux-x64 sign --if sig.tar.gz --of sig.tar.sig.gz <(printenv SIG_KEY)
env:
SIG_KEY: ${{ secrets.SIG_KEY }}
- name: Upload Release
run: |
gh release upload "${GITHUB_REF_NAME}" sig.tar.gz sig.tar.sig.gz
env:
GITHUB_TOKEN: ${{ github.TOKEN }}