Skip to content

Commit 6095441

Browse files
committed
Sync with microG unofficial installer
Signed-off-by: ale5000 <15793015+ale5000-git@users.noreply.github.com>
1 parent f4c3df9 commit 6095441

9 files changed

Lines changed: 89 additions & 27 deletions

File tree

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ docs/CODEOWNERS text eol=lf
99
.gitmodules text eol=lf
1010

1111
.editorconfig text eol=lf
12+
.mailmap text eol=lf
1213
.semgrepignore text eol=lf
1314
.shellcheckrc text eol=lf
1415
.simplecov text eol=lf

.github/workflows/auto-nightly.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ jobs:
7171
show-summary: false
7272
- name: "ZIP info"
7373
id: "info"
74+
shell: bash
7475
run: |
7576
# Retrieving informations...
7677
test -n '${{ steps.build.outputs.ZIP_FOLDER }}' || exit 3

.github/workflows/auto-release-from-tag.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ jobs:
5353
show-summary: false
5454
- name: "ZIP info"
5555
id: "info"
56+
shell: bash
5657
run: |
5758
# Retrieving informations...
5859
test -n '${{ steps.build.outputs.ZIP_FOLDER }}' || exit 3

.github/workflows/code-lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
name: "REUSE compliance check"
3030
runs-on: ubuntu-latest
3131
timeout-minutes: 5
32-
#if: "false"
32+
#if: "${{ false }}"
3333

3434
steps:
3535
- name: "Checkout sources"

.github/workflows/code-scan.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ on:
1111
branches:
1212
- "main"
1313
schedule:
14-
# At 05:00 AM, every 365 days, only in January (UTC)
15-
- cron: "0 5 */365 1 *"
14+
# Never
15+
- cron: "0 0 30 2 *"
1616

1717
jobs:
1818
pre-requisites:

.github/workflows/tag-and-release.yml

Lines changed: 73 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,64 +13,117 @@ jobs:
1313
name: "Create tag"
1414
runs-on: ubuntu-latest
1515
timeout-minutes: 10
16-
if: "${{ github.ref_type == 'branch' }}"
16+
if: "${{ github.ref_type == 'branch' && github.run_attempt == '1' }}"
1717
concurrency:
1818
group: "${{ github.repository_id }}-${{ github.workflow }}-tag"
19-
cancel-in-progress: true
19+
cancel-in-progress: false
2020
outputs:
2121
tag-name: "${{ steps.repo-info.outputs.version }}"
22+
tag-creation-success: "${{ steps.tag-creation.outputs.result }}"
2223
permissions:
2324
contents: write # Needed to create a tag
2425

2526
steps:
2627
- name: "Checkout sources"
2728
uses: actions/checkout@v5
28-
- name: "Parse version"
29+
with:
30+
sparse-checkout: |
31+
zip-content/module.prop
32+
sparse-checkout-cone-mode: false
33+
- name: "Parse info"
2934
id: "repo-info"
3035
shell: bash
3136
run: |
32-
# Parsing version...
37+
# Parsing info...
3338
version="$(grep -m 1 -e '^version=' -- './zip-content/module.prop' | cut -d '=' -f '2-' -s)" || exit "${?}"
39+
now="$(date -u -Is)" || exit "${?}"
3440
printf 'version=%s\n' "${version:?}" 1>> "${GITHUB_OUTPUT?}" || exit "${?}"
35-
- name: "Create tag"
41+
printf 'now=%s\n' "${now:?}" 1>> "${GITHUB_OUTPUT?}" || exit "${?}"
42+
- name: "Create annotated tag"
43+
id: tag-creation
3644
uses: actions/github-script@v7
3745
timeout-minutes: 5
3846
env:
47+
ACTOR_ID: "${{ github.actor_id }}"
3948
TAG_NAME: "${{ steps.repo-info.outputs.version }}"
49+
TAG_DATE: "${{ steps.repo-info.outputs.now }}"
4050
with:
51+
result-encoding: string
4152
retries: 3
4253
script: |
4354
/* jshint esversion: 6 */
55+
function errorOut(apiName, e)
56+
{
57+
let errorMsg = apiName + '() failed';
58+
if(e)
59+
{
60+
//console.warn('e.name: ' + e.name);
61+
//console.warn('e.statusText: ' + e.statusText);
62+
if(e.response && e.response.headers) console.warn('Rate limit - remaining: ' + e.response.headers['x-ratelimit-remaining']);
63+
if(e.status || e.message) errorMsg += ' with error ' + e.status + ' (' + e.message + ')';
64+
}
65+
throw new Error(errorMsg);
66+
}
67+
const actor_id = process.env.ACTOR_ID;
4468
const tag_name = process.env.TAG_NAME;
45-
console.log('::notice::Tag: ' + tag_name);
69+
const tag_date = process.env.TAG_DATE;
70+
console.log('::notice::Tag name: ' + tag_name);
71+
console.log('::notice::Tag date: ' + tag_date);
72+
const responseUser = await github.rest.users.getByUsername({
73+
username: context.actor
74+
}).catch(responseUser => responseUser);
75+
if(responseUser && responseUser.status === 200 && responseUser.data && responseUser.data.name) {
76+
// User data retrieved correctly
77+
} else {
78+
errorOut('users.getByUsername', responseUser);
79+
}
80+
// If public e-mail is missing, use default
81+
const email = responseUser.data.email ? responseUser.data.email : actor_id + '+' + context.actor + '@users.noreply.github.com';
82+
const responseTag = await github.rest.git.createTag({
83+
owner: context.repo.owner,
84+
repo: context.repo.repo,
85+
tag: tag_name,
86+
message: 'Release ' + tag_name,
87+
object: context.sha,
88+
type: 'commit',
89+
tagger: {
90+
name: responseUser.data.name,
91+
email: email,
92+
date: tag_date
93+
}
94+
}).catch(responseTag => responseTag);
95+
if(responseTag && responseTag.status === 201 && responseTag.data && responseTag.data.sha) {
96+
console.log('Tag object created correctly: ' + responseTag.data.sha);
97+
if(responseTag.data.verification)
98+
{
99+
console.log('Tag - verified: ' + responseTag.data.verification.verified);
100+
console.log('Tag - reason: ' + responseTag.data.verification.reason);
101+
console.log('Tag - verification date: ' + responseTag.data.verification.verified_at);
102+
}
103+
//console.log(JSON.stringify(responseTag.data));
104+
} else {
105+
errorOut('git.createTag', responseTag);
106+
}
46107
const response = await github.rest.git.createRef({
47108
owner: context.repo.owner,
48109
repo: context.repo.repo,
49110
ref: 'refs/tags/' + tag_name,
50-
sha: context.sha
111+
sha: responseTag.data.sha
51112
}).catch(response => response);
52-
if(response && response.status === 201) {
53-
console.log('Tag created.');
113+
if(response && response.status === 201 && response.data.ref) {
114+
console.log('Tag ref created correctly: ' + response.data.ref);
54115
return true;
55116
} else if(response && response.status === 422 && response.message === 'Reference already exists') {
56-
//console.warn('::warning::Tag already exist!!!');
57-
throw new Error('Tag already exist!!!');
117+
console.warn('::warning::Tag already exist!!!');
58118
} else {
59-
let errorMsg = 'createRef failed';
60-
if(response) {
61-
//if(response.name) console.warn('response.name: ' + response.name);
62-
//if(response.statusText) console.warn('response.statusText: ' + response.statusText);
63-
if(response.response && response.response.headers && response.response.headers['x-ratelimit-remaining']) console.warn('Remaining rate limit: ' + response.response.headers['x-ratelimit-remaining']);
64-
if(response.status && response.message) errorMsg += ' with error ' + response.status + ' (' + response.message + ')';
65-
}
66-
throw new Error(errorMsg);
119+
errorOut('git.createRef', response);
67120
}
68121
return false;
69122
70123
call-workflow:
71124
name: "Call workflow"
72125
needs: [create-tag]
73-
if: "${{ github.ref_type == 'branch' }}"
126+
if: "${{ needs.create-tag.outputs.tag-creation-success == 'true' }}"
74127
uses: "./.github/workflows/auto-release-from-tag.yml"
75128
with:
76129
tag-name: "${{ needs.create-tag.outputs.tag-name }}"

.gitignore

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,18 @@
22
# SPDX-License-Identifier: CC0-1.0
33

44
# Always ignore
5+
/.gnupg/
6+
/.ssh/
57
/coverage/
68
/dependency-graph-reports/
7-
/.ssh/
89
/.ash_history
910
/.bash_history
10-
/.wget-hsts
1111
/.lesshst
12+
/.wget-hsts
1213
desktop.ini
14+
*.dex
1315
*.log
1416
*.sarif
15-
*.dex
1617

1718
# Caches
1819
/.cache/

.mailmap

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# SPDX-FileCopyrightText: NONE
2+
# SPDX-License-Identifier: CC0-1.0
3+
4+
ale5000 <15793015+ale5000-git@users.noreply.github.com> <ale5000-git@users.noreply.github.com>
5+
ale5000 <15793015+ale5000-git@users.noreply.github.com> <920414-ale5000-git@users.noreply.gitlab.com>

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ if test "${CI:-false}" != 'false'; then
194194
if test -n "${CI_COMMIT_BRANCH-}" && test "${CI_COMMIT_BRANCH:?}" != "${CI_DEFAULT_BRANCH:-unknown}"; then
195195
BRANCH_NAME="$(sanitize_filename_part "${CI_COMMIT_BRANCH:?}" || :)" # GitLab
196196
elif test "${GITHUB_REF_TYPE-}" = 'branch' && test -n "${GITHUB_REF_NAME-}" && test "${GITHUB_REF_NAME:?}" != "${GITHUB_REPOSITORY_DEFAULT_BRANCH:-main}"; then
197-
BRANCH_NAME="$(sanitize_filename_part "${GITHUB_REF_NAME:?}" || :)" # GitHub
197+
BRANCH_NAME="$(sanitize_filename_part "${GITHUB_HEAD_REF:-${GITHUB_REF_NAME:?}}" || :)" # GitHub
198198
fi
199199
test -z "${BRANCH_NAME?}" || FILENAME_MIDDLE="${BRANCH_NAME:?}-${FILENAME_MIDDLE:?}"
200200
if test "${CI_PROJECT_NAMESPACE:-${GITHUB_REPOSITORY_OWNER:-unknown}}" != 'micro''5k'; then

0 commit comments

Comments
 (0)