Nightly Build #62
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
# Automation of Nightly Builds (similar to the Release Build) & upload to NoCloud nightly repository | |
name: Nightly Build | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: 16 2 * * * | |
jobs: | |
checkLR: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: octokit/[email protected] | |
id: check_last_run | |
with: | |
route: GET /repos/${{github.repository}}/actions/workflows/nightly_build.yml/runs?per_page=1&status=completed | |
env: | |
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' | |
- run: 'echo Last Nightly Build: ${{ fromJson(steps.check_last_run.outputs.data).workflow_runs[0].head_sha }}' | |
outputs: | |
last_sha: ${{ fromJson(steps.check_last_run.outputs.data).workflow_runs[0].head_sha }} | |
nightly_build: | |
runs-on: ubuntu-latest | |
needs: [checkLR] | |
strategy: | |
matrix: | |
node-version: | |
- 20.x | |
if: ${{ (needs.checkLR.outputs.last_sha != github.sha) && (github.repository_owner == 'DGAlexandru') }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: 'Use Node.js ${{ matrix.node-version }}' | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '${{ matrix.node-version }}' | |
- name: Install NPM | |
run: npm ci | |
- name: Generate OpenAPI Docs | |
run: npm run build_openapi_schema | |
- name: TypeScript Check | |
run: 'npm run ts-check --workspace={frontend,backend}' | |
- name: Code Lint | |
run: 'npm run lint --workspace={frontend,backend}' | |
- name: Build NoCloud FrontEnd | |
run: npm run build --workspace=frontend | |
- name: Build NoCloud BackEnd | |
run: npm run build --workspace=backend | |
- name: UPX-compress NoCloud binaries | |
run: npm run upx | |
- name: Test BackEnd | |
run: npm test --workspace=backend | |
env: | |
CI: true | |
- name: Generate Nightly ChangeLOG | |
run: npm run generate_nightly_changelog | |
- name: Generate Manifest | |
run: npm run build_release_manifest nightly | |
- name: Push generated files to Nightly repository | |
id: push_directory | |
uses: DGAlexandru/[email protected] | |
env: | |
SSH_DEPLOY_KEY: '${{ secrets.SSH_DEPLOY_KEY }}' | |
with: | |
source-directory: build | |
destination-github-username: NoCloudBot | |
destination-repository-name: NoCloud-nightly-builds | |
destination-repository-username: DGAlexandru | |
user-email: [email protected] | |
target-branch: master |