forked from firmadyne/libnvram
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Andrew Fasano
committed
Dec 15, 2023
1 parent
c9fb0c0
commit 81b0137
Showing
3 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Compile and publish libnvram | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build: | ||
runs-on: panda-arc | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Build | ||
run: | | ||
docker run --rm -v $PWD:/app -w /app ghcr.io/panda-re/embedded-toolchains_rust:latest /app/package.sh | ||
- name: Save package | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: libnvram-latest.tar.gz | ||
path: libnvram-latest.tar.gz | ||
|
||
- name: Create release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: release_${{ github.sha }} | ||
release_name: Release ${{ github.ref }} | ||
body: | | ||
Release @${{ github.ref }} | ||
draft: true | ||
prerelease: false | ||
- name: Upload release asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./libnvram-latest.tar.gz | ||
asset_name: libnvram-latest.tar.gz | ||
asset_content_type: application/gzip | ||
- name: Publish release | ||
uses: StuYarrow/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
id: ${{ steps.create_release.outputs.id }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
libnvram.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
set -eux | ||
|
||
# Host is mapped at /app | ||
|
||
rm -rf /app/out | ||
mkdir /app/out | ||
|
||
SCRATCH=$(mktemp -d)/libnvram | ||
mkdir $SCRATCH | ||
|
||
CC=arm-linux-musleabi-gcc make libnvram.so -C /app | ||
mv libnvram.so $SCRATCH/libnvram.so.arm | ||
make clean | ||
|
||
CC=mipsel-linux-musl-gcc make libnvram.so -C /app | ||
mv libnvram.so $SCRATCH/libnvram.so.mipsel | ||
make clean | ||
|
||
CC=mipseb-linux-musl-gcc make libnvram.so -C /app | ||
mv libnvram.so $SCRATCH/libnvram.so.mipseb | ||
make clean | ||
|
||
tar -czvf /app/libnvram-latest.tar.gz -C $(dirname $SCRATCH) libnvram | ||
rm -rf /app/out |