Skip to content

Commit fd19201

Browse files
authored
Merge pull request #516 from namehillsoftware/bugfix/github-releases
[Bugfix] Github releases
2 parents d16b51f + 59ae720 commit fd19201

File tree

4 files changed

+30
-5
lines changed

4 files changed

+30
-5
lines changed

.github/workflows/build-release.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ jobs:
1414

1515
steps:
1616
- uses: actions/checkout@v1
17+
with:
18+
fetch-depth: 0
1719
- name: Build and test project blue
1820
env:
1921
ANDROID_KEY_STORE_PASSWORD: "${{ secrets.ANDROID_KEY_STORE_PASSWORD }}"
2022
ANDROID_STORE_PASSWORD: "${{ secrets.ANDROID_STORE_PASSWORD }}"
21-
run: sh build-release.sh
23+
run: bash build-github-release.sh
2224
- name: Upload artifact
2325
uses: actions/upload-artifact@v4
2426
with:
@@ -30,7 +32,7 @@ jobs:
3032
name: Create release and upload artifacts
3133
needs:
3234
- build
33-
runs-on: ubuntu-latest
35+
runs-on: ubuntu-20.04
3436
steps:
3537
- name: Download artifacts
3638
uses: actions/download-artifact@v4
@@ -42,4 +44,4 @@ jobs:
4244
run: |
4345
wget -q https://github.com/TheAssassin/pyuploadtool/releases/download/continuous/pyuploadtool-x86_64.AppImage
4446
chmod +x pyuploadtool-x86_64.AppImage
45-
./pyuploadtool-x86_64.AppImage **/*.apk
47+
./pyuploadtool-x86_64.AppImage **/*-release.apk

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,12 @@ Run the tests via the IDE.
5252
Android Studio can perform the build. To run a CI build like it is run in Github, run the following command:
5353

5454
```shell script
55-
./build-release.sh
55+
./build-github-pr.sh
5656
```
5757

58+
This will leave artifacts that are owned by the root user. To run a build that leaves artifacts
59+
owned by the current user, run either `./build-release.sh` or `./build-apk.sh`.
60+
5861
## Deployment
5962

6063
Once changes are merged, a build will be deployed and published by the project blue maintainer.

build-github-release.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
3+
shopt -s globstar
4+
shopt -s nullglob
5+
6+
# Do not set user (`-u "$(id -u)":"$(id -g)"`) because it fails during Github actions. This means that
7+
# running this on a local machine will leave artifacts that have root ownership.
8+
9+
docker compose build && docker compose run --rm \
10+
-v "$(pwd)":/src -w /src \
11+
# -u "$(id -u)":"$(id -g)" \
12+
gradle \
13+
:projectBlueWater:testReleaseUnitTest \
14+
:projectBlueWater:assembleRelease
15+
16+
mkdir -p _artifacts
17+
18+
cp "$(pwd)"/projectBlueWater/build/**/*.apk "$(pwd)"/_artifacts/

build-release.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ rm -rf _artifacts
66
BUILD_USER=$(stat -c "%u" "$(pwd)")
77
BUILD_GROUP=$(stat -c "%g" "$(pwd)")
88

9-
docker compose build && docker compose run --rm -v "$(pwd)":/src -w /src -u "$BUILD_USER":"$BUILD_GROUP" gradle \
9+
docker compose build && docker compose run --rm \
10+
-v "$(pwd)":/src -w /src \
11+
-u "$BUILD_USER":"$BUILD_GROUP" gradle \
1012
:projectBlueWater:testReleaseUnitTest \
1113
:projectBlueWater:assembleRelease \
1214
:projectBlueWater:bundleRelease

0 commit comments

Comments
 (0)