Skip to content

Commit 6153cec

Browse files
committed
Sync with microG unofficial installer
1 parent b60b40d commit 6153cec

4 files changed

Lines changed: 78 additions & 48 deletions

File tree

.github/workflows/auto-nightly.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
nightly:
2626
name: "Nightly"
2727
runs-on: ubuntu-latest
28+
timeout-minutes: 30
2829
if: "${{ github.event_name == 'push' }}"
2930
concurrency:
3031
group: "${{ github.repository_id }}-${{ github.workflow }}-nightly"
@@ -234,7 +235,7 @@ jobs:
234235
workflow_id: workflow_filename
235236
}).catch(response => response);
236237
if(response && response.status === 204) {
237-
console.log('Succeeded.');
238+
console.log('Workflow enabled.');
238239
} else {
239240
let errorMsg = 'enableWorkflow failed';
240241
if(response && response.status && response.message) errorMsg += ' with error ' + response.status + ' (' + response.message + ')';

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

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,23 @@ on:
88
push:
99
tags:
1010
- "v[0-9]+.[0-9]+*"
11-
workflow_dispatch:
12-
concurrency:
13-
group: "${{ github.repository_id }}-${{ github.workflow }}"
14-
cancel-in-progress: false
11+
workflow_call:
12+
inputs:
13+
tag-name:
14+
required: true
15+
type: "string"
16+
1517
jobs:
1618
release:
1719
name: "Release"
1820
runs-on: ubuntu-latest
1921
timeout-minutes: 30
20-
if: "${{ startsWith(github.ref, 'refs/tags/v') && github.event_name != 'pull_request' }}"
22+
if: "${{ startsWith(github.ref, 'refs/tags/v') || github.event_name == 'workflow_dispatch' }}"
23+
concurrency:
24+
group: "${{ github.repository_id }}-${{ github.workflow }}-release"
25+
cancel-in-progress: false
2126
permissions:
22-
contents: write
27+
contents: write # Needed to create a release
2328

2429
steps:
2530
- name: "Checkout sources"
@@ -29,14 +34,21 @@ jobs:
2934
with:
3035
distribution: "temurin"
3136
java-version: "17"
32-
#cache: "gradle"
33-
- name: "Build"
37+
- name: "Build the flashable OTA zip"
3438
id: "build"
3539
shell: bash
3640
timeout-minutes: 10
3741
run: |
38-
### Building...
39-
'${{ github.workspace }}/gradlew' clean buildOtaOSS
42+
# Building...
43+
make clean buildotaoss
44+
- name: "Attest build provenance"
45+
id: "attest"
46+
uses: actions/attest-build-provenance@v2
47+
timeout-minutes: 10
48+
if: "${{ vars.ATTESTATION == 'true' && github.run_attempt == '1' && steps.build.outputs.ZIP_IS_ALPHA == 'false' && steps.build.outputs.ZIP_BUILD_TYPE_SUPPORTED == 'true' }}"
49+
with:
50+
subject-path: "${{ steps.build.outputs.ZIP_FOLDER }}/*.zip"
51+
show-summary: false
4052
- name: "ZIP info"
4153
run: |
4254
# Retrieve informations...
@@ -49,6 +61,7 @@ jobs:
4961
ZIP_IS_ALPHA='${{ steps.build.outputs.ZIP_IS_ALPHA }}'
5062
ZIP_SHA256='${{ steps.build.outputs.ZIP_SHA256 }}'
5163
ZIP_MD5='${{ steps.build.outputs.ZIP_MD5 }}'
64+
ZIP_ATTESTATION='${{ steps.attest.outputs.attestation-url }}'
5265
# Displaying informations...
5366
printf '%s\n' "::notice::Filename: ${ZIP_FILENAME:-Missing}"
5467
printf '%s\n' "::notice::Version: ${ZIP_VERSION:-Missing}"
@@ -58,14 +71,19 @@ jobs:
5871
printf '%s\n' "::notice::Is alpha: ${ZIP_IS_ALPHA:-Missing}"
5972
printf '%s\n' "::notice::SHA-256: ${ZIP_SHA256:-Missing}"
6073
printf '%s\n' "::notice::MD5: ${ZIP_MD5:-Missing}"
74+
printf '%s\n' "::notice::Attestation: ${ZIP_ATTESTATION:-Missing}"
6175
: "${ZIP_FOLDER:?}" || exit "${?}"
6276
- name: "Create release"
6377
uses: softprops/action-gh-release@v2
64-
if: "${{ steps.build.outputs.ZIP_BUILD_TYPE_SUPPORTED == 'true' && steps.build.outputs.ZIP_IS_ALPHA == 'false' }}"
78+
if: "${{ github.run_attempt == '1' && steps.build.outputs.ZIP_IS_ALPHA == 'false' && steps.build.outputs.ZIP_BUILD_TYPE_SUPPORTED == 'true' }}"
6579
with:
80+
tag_name: "${{ inputs.tag-name || github.ref_name }}"
81+
target_commitish: "${{ github.sha }}"
6682
body: "SHA-256: ${{ steps.build.outputs.ZIP_SHA256 }}\n\nSee the complete [**changelog**](./CHANGELOG.rst)."
6783
append_body: true
6884
generate_release_notes: true
6985
draft: false
70-
files: "${{ steps.build.outputs.ZIP_FOLDER }}/*.zip*"
86+
files: |
87+
${{ steps.build.outputs.ZIP_FOLDER }}/*.zip*
88+
${{ steps.attest.outputs.bundle-path }}
7189
fail_on_unmatched_files: true

.github/workflows/create-tag-now.yml

Lines changed: 40 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,24 @@
22
# SPDX-FileCopyrightText: (c) 2025 ale5000
33
# SPDX-License-Identifier: GPL-3.0-or-later
44

5-
name: "- Create tag now"
5+
name: "1) Tag and release"
66
permissions: {}
77
on:
88
workflow_dispatch:
9-
concurrency:
10-
group: "${{ github.repository_id }}-${{ github.workflow }}"
11-
cancel-in-progress: true
9+
1210
jobs:
13-
tag-creation:
14-
name: "Tag creation"
11+
create-tag:
12+
name: "Create tag"
1513
runs-on: ubuntu-latest
1614
timeout-minutes: 10
17-
if: "${{ ! startsWith(github.ref, 'refs/tags/') }}"
15+
if: "${{ github.ref_type == 'branch' }}"
16+
concurrency:
17+
group: "${{ github.repository_id }}-${{ github.workflow }}-tag"
18+
cancel-in-progress: true
19+
outputs:
20+
tag-name: "${{ steps.repo-info.outputs.version }}"
1821
permissions:
1922
contents: write # Needed to create a tag
20-
actions: write # Needed to trigger a workflow
2123

2224
steps:
2325
- name: "Checkout sources"
@@ -27,37 +29,44 @@ jobs:
2729
shell: bash
2830
run: |
2931
# Parsing version...
30-
version="$(grep -m 1 -e '^version=' -- 'zip-content/module.prop' | cut -d '=' -f '2-' -s)" || exit "${?}"
31-
printf 'version=%s\n' "${version:?}" >> "${GITHUB_OUTPUT?}" || exit "${?}"
32+
version="$(grep -m 1 -e '^version=' -- './zip-content/module.prop' | cut -d '=' -f '2-' -s)" || exit "${?}"
33+
printf 'version=%s\n' "${version:?}" 1>> "${GITHUB_OUTPUT?}" || exit "${?}"
3234
- name: "Create tag"
3335
uses: actions/github-script@v7
36+
timeout-minutes: 5
37+
env:
38+
TAG_NAME: "${{ steps.repo-info.outputs.version }}"
3439
with:
3540
retries: 3
3641
script: |
3742
/* jshint esversion: 6 */
38-
console.log('::notice::Tag name: ${{ steps.repo-info.outputs.version }}');
43+
const tag_name = process.env.TAG_NAME;
44+
console.log('::notice::Tag: ' + tag_name);
3945
const response = await github.rest.git.createRef({
4046
owner: context.repo.owner,
4147
repo: context.repo.repo,
42-
ref: 'refs/tags/${{ steps.repo-info.outputs.version }}',
48+
ref: 'refs/tags/' + tag_name,
4349
sha: context.sha
44-
}).catch(error => {
45-
if(error.status === 422 && error.message === 'Reference already exists') {
46-
console.warn('::warning::Tag already exist, ignored!!!');
47-
return;
48-
}
49-
console.error('::error::Tag creation failed with error: ' + error.status);
50-
console.error('::error::Error message: ' + error.message);
51-
console.log('');
52-
throw error;
53-
});
54-
if(response && response.status >= 200 && response.status < 300) {
55-
console.log('');
56-
console.log('Triggered the workflow for the release.');
57-
github.rest.actions.createWorkflowDispatch({
58-
owner: context.repo.owner,
59-
repo: context.repo.repo,
60-
workflow_id: 'auto-release-from-tag.yml',
61-
ref: 'refs/tags/${{ steps.repo-info.outputs.version }}'
62-
});
50+
}).catch(response => response);
51+
if(response && response.status === 201) {
52+
console.log('Tag created.');
53+
return true;
54+
} else if(response && response.status === 422 && response.message === 'Reference already exists') {
55+
//console.warn('::warning::Tag already exist!!!');
56+
throw new Error('Tag already exist!!!');
57+
} else {
58+
let errorMsg = 'createRef failed';
59+
if(response && response.status && response.message) errorMsg += ' with error ' + response.status + ' (' + response.message + ')';
60+
throw new Error(errorMsg);
6361
}
62+
return false;
63+
64+
call-workflow:
65+
name: "Call workflow"
66+
needs: [create-tag]
67+
if: "${{ github.ref_type == 'branch' }}"
68+
uses: "./.github/workflows/auto-release-from-tag.yml"
69+
with:
70+
tag-name: "${{ needs.create-tag.outputs.tag-name }}"
71+
permissions:
72+
contents: write # Needed to create a release

.gitlab-ci.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ stages:
4242
- "LICENSE*.rst"
4343
- "build.sh"
4444
- "conf-*.sh"
45-
- if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_TAG && $CI_COMMIT_TAG != "nightly"
45+
when: always
4646
cache: []
4747
script: "BUILD_TYPE='oss' './build.sh'"
4848

@@ -60,20 +60,22 @@ build-job:
6060
- "LICENSE*.rst"
6161
- "build.sh"
6262
- "conf-*.sh"
63-
- if: $CI_PIPELINE_SOURCE == "schedule" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
63+
when: always
64+
- if: $CI_PIPELINE_SOURCE == "schedule" && $CI_COMMIT_TAG == "nightly"
65+
when: always
6466
script: "BUILD_TYPE='full' './build.sh'"
6567
artifacts:
6668
paths:
6769
- "output/*.zip*"
6870
expire_in: "15 minutes"
6971

7072
# Cache expiration: 14 days
71-
ping-cache:
73+
.ping-cache:
7274
stage: build
7375
interruptible: false
7476
timeout: "5 minutes"
7577
rules:
76-
- if: $CI_PIPELINE_SOURCE == "schedule"
78+
- if: $CI_PIPELINE_SOURCE == "schedule" && $CI_COMMIT_TAG == "nightly"
7779
when: always
7880
before_script: []
7981
script: ":"

0 commit comments

Comments
 (0)