Update auto-nightly.yml #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
# 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: | | |
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 | |
} | |
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 |