forked from micro5k/microg-unofficial-installer
-
Notifications
You must be signed in to change notification settings - Fork 0
117 lines (115 loc) · 4.14 KB
/
auto-nightly.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
---
# SPDX-FileCopyrightText: (c) 2025 ale5000
# SPDX-License-Identifier: GPL-3.0-or-later
name: "Nightly"
permissions: {}
on:
push:
branches:
- "main"
jobs:
base-job:
name: "Nightly"
runs-on: ubuntu-latest
permissions: write-all
#permissions:
# variables: read
steps:
- name: "Checkout sources"
uses: actions/checkout@v4
- name: "Script"
uses: actions/github-script@v7
with:
retries: 3
script: |
console.log('::notice::Tag name: ${{ steps.repo-info.outputs.version }}')
const result = await github.rest.git.updateRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/nightly',
sha: context.sha
}).catch(error => {
console.log('Error message: ' + error.message)
console.log('Error message: ' + error.status)
return
if(error.status == 422 && error.message == 'Reference already exists') {
console.log('::warning::Tag already exist, ignored!!!')
return
throw error
}
console.log('::error::Tag creation failed with error ' + error.status)
const result = await github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/nightly',
sha: context.sha
})
})
- name: "Script"
uses: actions/github-script@v7
if: false
with:
retries: 3
script: |
await github.request('POST /repos/{owner}/{repo}/actions/variables', {
owner: context.repo.owner,
repo: context.repo.repo,
name: 'LAST_NIGHTLY_SHA256',
value: '1234',
headers: {
'X-GitHub-Api-Version': '2022-11-28'
}
})
console.log('OK')
const result = await github.request('GET /repos/{owner}/{repo}/actions/variables/{name}', {
owner: context.repo.owner,
repo: context.repo.repo,
name: 'LAST_NIGHTLY_SHA256',
headers: {
'X-GitHub-Api-Version': '2022-11-28'
}
})
console.log(result.status)
console.log(result.value)
- name: "Setup Java"
uses: actions/setup-java@v4
if: false
with:
distribution: "temurin"
java-version: "17"
#cache: "gradle"
- name: "Build"
id: "build"
if: false
shell: bash
run: |
### Building...
'${{ github.workspace }}/gradlew' clean buildOtaOSS
- name: "ZIP info"
if: false
run: |
# Retrieve informations...
ZIP_FOLDER='${{ steps.build.outputs.ZIP_FOLDER }}'
ZIP_FILENAME='${{ steps.build.outputs.ZIP_FILENAME }}'
ZIP_VERSION='${{ steps.build.outputs.ZIP_VERSION }}'
ZIP_SHORT_COMMIT_ID='${{ steps.build.outputs.ZIP_SHORT_COMMIT_ID }}'
ZIP_BUILD_TYPE='${{ steps.build.outputs.ZIP_BUILD_TYPE }}'
ZIP_SHA256='${{ steps.build.outputs.ZIP_SHA256 }}'
ZIP_MD5='${{ steps.build.outputs.ZIP_MD5 }}'
# Displaying informations...
printf '%s\n' "::notice::Filename: ${ZIP_FILENAME:-Missing}"
printf '%s\n' "::notice::Version: ${ZIP_VERSION:-Missing}"
printf '%s\n' "::notice::Short commit ID: ${ZIP_SHORT_COMMIT_ID:-Missing}"
printf '%s\n' "::notice::Build type: ${ZIP_BUILD_TYPE:-Missing}"
printf '%s\n' "::notice::SHA-256: ${ZIP_SHA256:-Missing}"
printf '%s\n' "::notice::MD5: ${ZIP_MD5:-Missing}"
: "${ZIP_FOLDER:?}" || exit "${?}"
- name: "Create release"
uses: softprops/action-gh-release@v2
if: false
with:
body: "See the complete [**changelog**](./CHANGELOG.rst)."
append_body: true
generate_release_notes: true
files: "${{ steps.build.outputs.ZIP_FOLDER }}/*.zip*"
fail_on_unmatched_files: false