Skip to content

Commit e80a550

Browse files
committed
update to build on github actions
1 parent d9dc795 commit e80a550

File tree

4 files changed

+50
-52
lines changed

4 files changed

+50
-52
lines changed

.github/workflows/build.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Build firejail
2+
3+
on:
4+
push:
5+
6+
jobs:
7+
build:
8+
strategy:
9+
matrix:
10+
include:
11+
- arch: amd64
12+
runner: ubuntu-latest
13+
- arch: arm64
14+
runner: ubuntu-24.04-arm
15+
runs-on: ${{ matrix.runner }}
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Install dependencies
19+
run: sudo apt-get update && sudo apt-get install -y p7zip-full
20+
- name: Build
21+
env:
22+
CI_ARCH: ${{ matrix.arch }}
23+
run: scripts/ci-build.sh
24+
- uses: actions/upload-artifact@v4
25+
with:
26+
name: binaries-${{ matrix.arch }}
27+
path: binaries/
28+
29+
deploy:
30+
needs: build
31+
if: github.ref_type == 'tag'
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v4
35+
- uses: actions/download-artifact@v4
36+
with:
37+
path: binaries/
38+
merge-multiple: true
39+
- name: Deploy
40+
run: scripts/ci-deploy.sh

.gitlab-ci.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

scripts/ci-build.sh

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,20 @@ export CI_OS="linux"
44

55
if [ "$CI_ARCH" = "amd64" ]; then
66
export CFLAGS=-m64 CXXFLAGS=-m64 LDFLAGS=-m64
7-
else
8-
export CFLAGS=-m32 CXXFLAGS=-m32 LDFLAGS=-m32
97
fi
108

119
7za | head -2
1210
gcc -v
1311

1412
export FIREJAIL_VERSION=head
15-
export CI_VERSION=$CI_BUILD_REF_NAME
16-
if [ -n "$CI_BUILD_TAG" ]; then
17-
export FIREJAIL_VERSION=$CI_BUILD_TAG
18-
export CI_VERSION=v${CI_BUILD_REF_NAME}
13+
export CI_VERSION=$GITHUB_REF_NAME
14+
if [ "$GITHUB_REF_TYPE" = "tag" ]; then
15+
export FIREJAIL_VERSION=$GITHUB_REF_NAME
16+
export CI_VERSION=v${GITHUB_REF_NAME}
1917
fi
2018

2119
git clone https://github.com/netblue30/firejail.git firejail-repo
22-
(cd firejail-repo && git checkout $CI_BUILD_REF_NAME && ./configure --disable-globalcfg && make -j3)
20+
(cd firejail-repo && git checkout $GITHUB_REF_NAME && ./configure --disable-globalcfg && make -j3)
2321
mv firejail-repo/src/firejail/firejail .
2422

2523
strip firejail
@@ -44,7 +42,6 @@ mv firejail $BINARIES_DIR/$CI_VERSION
4442

4543
(cd $BINARIES_DIR/$CI_VERSION && sha1sum * > SHA1SUMS)
4644

47-
if [ -n "$CI_BUILD_TAG" ]; then
48-
echo $CI_BUILD_TAG > $BINARIES_DIR/LATEST
45+
if [ "$GITHUB_REF_TYPE" = "tag" ]; then
46+
echo $GITHUB_REF_NAME > $BINARIES_DIR/LATEST
4947
fi
50-

scripts/ci-deploy.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#!/bin/sh
2-
3-
# upload all artifacts from a single worker
4-
gsutil -m cp -r -a public-read binaries/* gs://dl.itch.ovh/firejail/
5-
1+
#!/bin/sh -xe
2+
# placeholder deploy - just show collected artifacts
3+
ls -lR binaries/

0 commit comments

Comments
 (0)