Skip to content

Commit 90800b1

Browse files
committed
Create universal release ci
1 parent 82060b9 commit 90800b1

File tree

5 files changed

+118
-13
lines changed

5 files changed

+118
-13
lines changed

.docker/build-linux.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
set -ex
44

5+
export PS4='$LINENO: '
6+
57
export CCACHE_DIR=/ccache
68

79
LOCAL_REPO_PATH=/local/repos
@@ -243,10 +245,15 @@ if [[ "$BUILD_FROM_TARBALL" == "1" ]]; then
243245
esac
244246
else
245247
# shellcheck disable=SC2086
246-
cmake ../dwarfs/ $CMAKE_ARGS -DWITH_EXAMPLE=1
248+
cmake ../dwarfs/ $CMAKE_ARGS -DWITH_EXAMPLE=0
247249

248250
time $BUILD_TOOL
249251

252+
cp /root/build/universal/dwarfs-universal /workspace
253+
254+
# copy_artifacts fails, do not need to get there, already built, stop here
255+
exit 0
256+
250257
$RUN_TESTS
251258

252259
if [[ "-$BUILD_TYPE-" == *-coverage-* ]]; then

.github/workflows/build.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ name: 'DwarFS CI Build'
22

33
on:
44
workflow_dispatch:
5-
push:
6-
branches:
7-
- main
8-
- 'mhx/**'
9-
tags:
10-
- v*
5+
# push:
6+
# branches:
7+
# - main
8+
# - 'mhx/**'
9+
# tags:
10+
# - v*
1111

1212
permissions:
1313
contents: read

.github/workflows/codeql.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
name: "CodeQL"
22

33
on:
4-
push:
5-
branches: [ "main", "mhx/work" ]
6-
pull_request:
7-
branches: [ "main" ]
8-
schedule:
9-
- cron: '34 3 * * 0'
4+
workflow_dispatch:
5+
# push:
6+
# branches: [ "main", "mhx/work" ]
7+
# pull_request:
8+
# branches: [ "main" ]
9+
# schedule:
10+
# - cron: '34 3 * * 0'
1011

1112
jobs:
1213
analyze:

.github/workflows/release.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: default
4+
on: [workflow_dispatch, push, pull_request]
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v4
13+
with:
14+
submodules: 'true'
15+
fetch-depth: '0'
16+
ref: ${{ github.ref }}
17+
18+
- name: Compile and extract artifacts from docker container
19+
run: |
20+
# This creates the dist folder
21+
./build.sh
22+
mkdir -p dist
23+
cp dwarfs-universal dist
24+
25+
- name: Set permissions for dist directory
26+
run: |
27+
sudo chown -R "$(id -u)":"$(id -g)" dist/
28+
sudo chmod -R 766 dist/
29+
30+
- name: Upload artifacts to release
31+
uses: actions/upload-artifact@v4
32+
with:
33+
name: dwarfs
34+
path: 'dist'
35+
36+
- name: Compute Short SHA
37+
id: ssha
38+
run: |
39+
echo "ssha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
40+
41+
outputs:
42+
ssha: ${{ steps.ssha.outputs.ssha }}
43+
44+
45+
release:
46+
permissions: write-all
47+
needs: [build]
48+
runs-on: ubuntu-latest
49+
50+
steps:
51+
- uses: actions/download-artifact@v4
52+
with:
53+
name: dwarfs
54+
55+
- name: release
56+
uses: marvinpinto/action-automatic-releases@latest
57+
with:
58+
title: Continuous ${{ needs.build.outputs.ssha }}
59+
automatic_release_tag: ${{ needs.build.outputs.ssha }}
60+
prerelease: false
61+
draft: false
62+
files: |
63+
*dwarfs*
64+
repo_token: ${{ secrets.GITHUB_TOKEN }}

build.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env bash
2+
3+
######################################################################
4+
# @author : Ruan E. Formigoni ([email protected])
5+
# @file : build
6+
# @created : Monday Sep 30, 2024 09:13:29 -03
7+
#
8+
# @description :
9+
######################################################################
10+
11+
set -e
12+
13+
DIR_SCRIPT="$(cd -- "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
14+
15+
# Create build environment
16+
cd "$DIR_SCRIPT"/.docker
17+
18+
docker build . -t dwarfs -f ./Dockerfile.ubuntu \
19+
--build-arg ARCH=amd64 \
20+
--build-arg SCRIPT=build-linux.sh
21+
22+
# Build dwarfs
23+
cd "$DIR_SCRIPT"
24+
mkdir -p dist
25+
docker run --rm --cap-add SYS_ADMIN --device /dev/fuse --privileged \
26+
-u 0:0 \
27+
--mount type=bind,source="$PWD",target=/workspace \
28+
--env BUILD_TYPE=gcc-release-ninja-static-notest \
29+
--env BUILD_ARCH=amd64 \
30+
--env BUILD_DIST=arch \
31+
--env CC=/usr/bin/gcc-14 \
32+
--env CXX=/usr/bin/g++-14 \
33+
dwarfs

0 commit comments

Comments
 (0)