Skip to content

Commit

Permalink
Add github release.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
claytonsingh committed Sep 19, 2024
1 parent c5ca71d commit f23e5ae
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
on:
push:
tags: 'r*'

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
steps:
- uses: actions/checkout@v4
- name: Build
run: |
cd exchange
mkdir bin
gcc exchange.c -s -Os -o exchange
- name: Package
run: |
tar -czvOC bin . > exchange.tar.gz
- name: Upload Release
run: |
gh release upload "${GITHUB_REF_NAME}" exchange.tar.gz
env:
GITHUB_TOKEN: ${{ github.TOKEN }}
build-sig:
name: Build Sig
needs: [create-release]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '>=1.20'
- name: Build
run: |
cd sig
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.exe .
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
echo "${SIG_KEY}" | bin/sig-linux-amd64 sign --if sig.tar.gz /dev/stdin --of sig.tar.sig.gz
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 }}

0 comments on commit f23e5ae

Please sign in to comment.