Skip to content

Commit 14d6f12

Browse files
author
Andrew Fasano
committed
CI: auto build and release binaries
1 parent a916fc7 commit 14d6f12

File tree

2 files changed

+81
-0
lines changed

2 files changed

+81
-0
lines changed

.github/workflows/build.yml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Compile and Publish genext2fs
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- main
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-20.04
12+
permissions:
13+
contents: write
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Build
20+
run: |
21+
docker run --rm -v $PWD:/app -w /app ubuntu:22.04 /app/build.sh
22+
tar -czvf genext2fs.tar.gz build
23+
24+
- name: Save package
25+
uses: actions/upload-artifact@v3
26+
with:
27+
name: genext2fs
28+
path: build
29+
30+
- name: Create release
31+
id: create_release
32+
uses: actions/create-release@v1
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35+
with:
36+
tag_name: release_${{ github.sha }}
37+
release_name: Release ${{ github.ref }}
38+
body: |
39+
Release @${{ github.ref }}
40+
draft: true
41+
prerelease: false
42+
43+
- name: Upload release asset
44+
uses: actions/upload-release-asset@v1
45+
env:
46+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
with:
48+
upload_url: ${{ steps.create_release.outputs.upload_url }}
49+
asset_path: ./genext2fs.tar.gz
50+
asset_name: genext2fs.tar.gz
51+
asset_content_type: application/gzip
52+
53+
- name: Publish release
54+
uses: StuYarrow/[email protected]
55+
env:
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
with:
58+
id: ${{ steps.create_release.outputs.id }}

build.sh

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
set -eux
4+
5+
# Add source URIs
6+
sed -Ei 's/^# deb-src /deb-src /' /etc/apt/sources.list
7+
apt-get update
8+
9+
# Download dependencies
10+
apt build-dep -y genext2fs
11+
12+
# Configure with libarchive
13+
./autogen.sh
14+
15+
./configure --enable-libarchive
16+
17+
# Build
18+
make -j$(nproc)
19+
20+
ls -alth genext2fs
21+
22+
# Tar
23+
tar cvzf /app/genext2fs.tar.gz genext2fs

0 commit comments

Comments
 (0)