Skip to content

Commit ac9e46b

Browse files
committed
Sync with microG unofficial installer
1 parent 486f1e5 commit ac9e46b

File tree

9 files changed

+99
-44
lines changed

9 files changed

+99
-44
lines changed

.github/workflows/auto-nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
- name: "Attest build provenance"
5252
id: "attest"
5353
uses: actions/attest-build-provenance@v2
54-
if: "${{ vars.NIGHTLY_ATTESTATION == 'true' && github.run_attempt == '1' && steps.build.outputs.ZIP_BUILD_TYPE_SUPPORTED == 'true' }}"
54+
if: "${{ vars.NIGHTLY_ATTESTATION == 'true' && github.run_attempt == '1' && steps.build.outputs.ZIP_IS_ALPHA == 'true' && steps.build.outputs.ZIP_BUILD_TYPE_SUPPORTED == 'true' }}"
5555
with:
5656
subject-path: "${{ steps.build.outputs.ZIP_FOLDER }}/*.zip"
5757
show-summary: false

.github/workflows/code-linting-2.yml

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,27 +11,46 @@ on:
1111
schedule:
1212
# At 05:00 AM, every 365 days, only in January (UTC)
1313
- cron: "0 5 */365 1 *"
14+
1415
jobs:
16+
verify-tokens:
17+
name: "Verify tokens"
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 10
20+
if: "${{ github.event_name == 'push' }}"
21+
outputs:
22+
codacy-token-set: "${{ steps.check-tokens.outputs.CODACY_TOKEN_SET }}"
23+
sonar-token-set: "${{ steps.check-tokens.outputs.SONAR_TOKEN_SET }}"
24+
steps:
25+
- name: "Verify tokens"
26+
id: check-tokens
27+
run: |
28+
# Verifying tokens...
29+
# Codacy
30+
if test -n '${{ secrets.CODACY_PROJECT_TOKEN }}'; then token_set='true'; else token_set='false'; fi
31+
printf 'CODACY_TOKEN_SET=%s\n' "${token_set:?}" 1>> "${GITHUB_OUTPUT?}"
32+
# SonarQube
33+
if test -n '${{ secrets.SONAR_TOKEN }}'; then token_set='true'; else token_set='false'; fi
34+
printf 'SONAR_TOKEN_SET=%s\n' "${token_set:?}" 1>> "${GITHUB_OUTPUT?}"
35+
1536
codacy:
1637
name: "Codacy"
38+
needs: [verify-tokens]
1739
runs-on: ubuntu-latest
18-
if: "${{ github.event_name == 'push' }}"
40+
timeout-minutes: 20
41+
if: "${{ github.event_name == 'push' && needs.verify-tokens.outputs.codacy-token-set == 'true' }}"
1942
concurrency:
2043
group: "${{ github.repository_id }}-${{ github.workflow }}-codacy"
2144
cancel-in-progress: false
2245
permissions:
2346
security-events: write
2447

2548
steps:
26-
- name: "Verify token"
27-
shell: bash
28-
run: |
29-
# Verifying token...
30-
test -n '${{ secrets.CODACY_PROJECT_TOKEN }}' || exit 3
3149
- name: "Checkout sources"
3250
uses: actions/checkout@v4
3351
- name: "Codacy analysis"
3452
uses: codacy/codacy-analysis-cli-action@v4
53+
timeout-minutes: 10
3554
with:
3655
project-token: "${{ secrets.CODACY_PROJECT_TOKEN }}"
3756
#verbose: true
@@ -55,20 +74,18 @@ jobs:
5574

5675
sonarqube:
5776
name: "SonarQube"
77+
needs: [verify-tokens]
5878
runs-on: ubuntu-latest
59-
if: "${{ github.event_name == 'push' }}"
79+
timeout-minutes: 20
80+
if: "${{ github.event_name == 'push' && needs.verify-tokens.outputs.sonar-token-set == 'true' }}"
6081

6182
steps:
62-
- name: "Verify token"
63-
shell: bash
64-
run: |
65-
# Verifying token...
66-
test -n '${{ secrets.SONAR_TOKEN }}' || exit 3
6783
- name: "Checkout sources"
6884
uses: actions/checkout@v4
6985
with:
7086
fetch-depth: "0" # Shallow clones should be disabled for a better relevancy of analysis
7187
- name: "SonarQube scan"
7288
uses: SonarSource/sonarqube-scan-action@v5
89+
timeout-minutes: 10
7390
env:
7491
SONAR_TOKEN: "${{ secrets.SONAR_TOKEN }}"

.github/workflows/coverage.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
base-job:
1313
name: "Base"
1414
runs-on: ubuntu-latest
15+
timeout-minutes: 20
1516
concurrency:
1617
group: "${{ github.repository_id }}-${{ github.workflow }}-base"
1718
cancel-in-progress: false
@@ -31,7 +32,7 @@ jobs:
3132
- name: "Install Bashcov and simplecov-lcov"
3233
run: |
3334
# Installing Bashcov and simplecov-lcov...
34-
gem install bashcov:3.1.3 simplecov-lcov
35+
gem install bashcov:3.2.0 simplecov-lcov
3536
- name: "Build (with coverage)"
3637
id: "build"
3738
shell: bash

.github/workflows/periodic-checks.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ jobs:
6565
dep5-validation:
6666
name: "Validate dep5"
6767
runs-on: ubuntu-latest
68+
timeout-minutes: 20
6869

6970
steps:
7071
- name: "Checkout sources"

.github/workflows/scripts-testing.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
base:
2727
strategy:
2828
matrix:
29-
os: [ubuntu-latest, windows-latest, macos-latest, macos-13]
29+
os: [ubuntu-latest, windows-latest, macos-latest]
3030
fail-fast: false
3131
name: "${{ matrix.os }}"
3232
runs-on: "${{ matrix.os }}"
@@ -104,6 +104,7 @@ jobs:
104104
GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
105105
- name: "Test scripts"
106106
shell: bash
107+
timeout-minutes: 10
107108
run: |
108109
# Testing scripts...
109110
EXIT_CODE='0'
@@ -121,7 +122,7 @@ jobs:
121122
if test "${current_os:?}" = 'Linux'; then PATH="${PATH:-/usr/bin}:${workspace_dir:?}/cache/shells/extracted/bosh/opt/schily/bin" || exit "${?}"; fi
122123
if diff 1> /dev/null 2>&1 -- "$(command -v 'sh' || :)" "$(command -v 'bash' || :)"; then SH_IS_BASH='true'; fi
123124
if test "${current_os:?}" = 'Linux'; then
124-
sudo apt-get -y -qq install 'mksh' 'yash' 'posh' 1> /dev/null
125+
sudo DEBIAN_FRONTEND='noninteractive' apt-get -y -qq --no-install-recommends --no-upgrade install 'mksh' 'yash' 'posh' 1> /dev/null 2>&1 || exit "${?}"
125126
elif test "${current_os:?}" = 'macOS'; then
126127
brew 2> /dev/null update --quiet || exit "${?}"
127128
brew 1> /dev/null install --quiet 'mksh' 'oksh' 'ksh93' 'yash' || exit "${?}"

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33

44
# Files to always ignore
55
/coverage/
6+
/dependency-graph-reports/
67
/.ssh/
78
/.ash_history
89
/.bash_history
910
/.wget-hsts
1011
/.lesshst
12+
desktop.ini
1113
*.log
1214
*.sarif
1315
*.dex
@@ -17,7 +19,6 @@
1719
/.git/
1820
__pycache__/
1921
.DS_Store
20-
desktop.ini
2122
Thumbs.db
2223

2324
# VS Code files

.gitlab-ci.yml

Lines changed: 37 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,54 +5,65 @@
55
image: "eclipse-temurin:17-jdk-alpine"
66

77
variables:
8-
GIT_DEPTH: "1"
8+
GIT_DEPTH: 1
99

10-
# Cache expiration: 14 days
1110
cache:
1211
key: "cache-build"
1312
paths:
14-
- cache/build/
13+
- cache/build
1514
when: "always"
1615

17-
before_script: |
18-
# Install dependencies
19-
apk add bash zip~=3.0 wget || exit "${?}"
16+
default:
17+
before_script: |
18+
# Install dependencies
19+
apk add bash zip~=3.0 wget || exit "${?}"
2020
21-
include:
22-
# - template: Security/Dependency-Scanning.gitlab-ci.yml
23-
# - template: Security/License-Scanning.gitlab-ci.yml
24-
- template: Security/SAST.gitlab-ci.yml
25-
# - template: Security/Secret-Detection.gitlab-ci.yml
21+
workflow:
22+
auto_cancel:
23+
on_new_commit: "interruptible"
2624

2725
stages:
2826
- build
2927
- test
3028

31-
build-oss-job:
29+
# Temporarily disabled
30+
.build-oss-job:
3231
stage: build
32+
interruptible: true
3333
rules:
34-
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
35-
- if: $CI_COMMIT_TAG && $CI_COMMIT_TAG != "nightly"
34+
- if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
35+
- if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG && $CI_COMMIT_TAG != "nightly"
3636
cache: []
3737
script: "BUILD_TYPE='oss' './build.sh'"
3838

3939
build-job:
4040
stage: build
41+
interruptible: true
4142
rules:
42-
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
43+
- if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
44+
changes:
45+
- "LICENSES/**"
46+
- "includes/common.sh"
47+
- "tools/**"
48+
- "zip-content/**"
49+
- ".gitlab-ci.yml"
50+
- "build.sh"
51+
- "conf-*.sh"
4352
script: "BUILD_TYPE='full' './build.sh'"
4453
artifacts:
4554
paths:
46-
- output/*.zip*
47-
expire_in: 30 minutes
55+
- "output/*.zip*"
56+
expire_in: "20 minutes"
4857

49-
# license_scanning:
50-
# stage: test
51-
# artifacts:
52-
# paths:
53-
# - gl-license-scanning-report.json
58+
# Cache expiration: 14 days
59+
ping-cache:
60+
stage: build
61+
rules:
62+
- if: $CI_PIPELINE_SOURCE == "schedule"
63+
when: always
64+
inherit:
65+
default: false
66+
script: ":"
5467

55-
sast:
56-
stage: test
57-
cache: []
58-
before_script: []
68+
# Temporarily disabled
69+
#include: ".gitlab/security-scans.yml"

.gitlab/security-scans.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
# SPDX-FileCopyrightText: none
3+
# SPDX-License-Identifier: CC0-1.0
4+
5+
include:
6+
- template: Security/SAST.gitlab-ci.yml
7+
#- template: Security/License-Scanning.gitlab-ci.yml
8+
#- template: Security/Secret-Detection.gitlab-ci.yml
9+
10+
sast:
11+
cache: []
12+
inherit:
13+
default: false
14+
15+
#license_scanning:
16+
# cache: []
17+
# inherit:
18+
# default: false

build.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ if test "${OPENSOURCE_ONLY:?}" != 'false'; then
138138
{
139139
printf 'ZIP_FOLDER=%s\n' "${OUT_DIR?}"
140140
printf 'ZIP_FILENAME=\n'
141-
printf 'ZIP_VERSION=\n'
141+
printf 'ZIP_VERSION=%s\n' "${MODULE_VER?}"
142142
printf 'ZIP_SHORT_COMMIT_ID=%s\n' "${ZIP_SHORT_COMMIT_ID?}"
143143
printf 'ZIP_BUILD_TYPE=%s\n' "${BUILD_TYPE?}"
144144
printf 'ZIP_BUILD_TYPE_SUPPORTED=%s\n' 'false'
@@ -192,6 +192,11 @@ if test "${CI:-false}" != 'false'; then
192192
if test "${CI_PROJECT_NAMESPACE:-${GITHUB_REPOSITORY_OWNER:-unknown}}" != 'micro''5k'; then
193193
FILENAME_MIDDLE="fork-${FILENAME_MIDDLE:?}" # GitLab / GitHub
194194
fi
195+
else
196+
branch_name="$(git 2> /dev/null branch --show-current)" || branch_name="$(git 2> /dev/null rev-parse --abbrev-ref HEAD)" || branch_name=''
197+
if test -n "${branch_name?}" && test "${branch_name:?}" != 'main'; then
198+
FILENAME_MIDDLE="${branch_name:?}-${FILENAME_MIDDLE:?}"
199+
fi
195200
fi
196201

197202
FILENAME="${FILENAME_START:?}${FILENAME_MIDDLE:?}${FILENAME_END:?}"

0 commit comments

Comments
 (0)