2022-06-02 09:10:17 +00:00
|
|
|
# Creates nightly deployment builds for main targets. Note this does not cover package distribution channels,
|
2021-09-20 05:09:10 +00:00
|
|
|
# such as choco.
|
2021-02-18 06:18:04 +00:00
|
|
|
|
2021-02-18 06:18:53 +00:00
|
|
|
name: nightly
|
2021-02-18 06:18:04 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
schedule:
|
|
|
|
- cron: "0 0 * * *"
|
|
|
|
workflow_dispatch:
|
2021-05-15 21:20:28 +00:00
|
|
|
inputs:
|
|
|
|
isMock:
|
2021-06-21 23:56:59 +00:00
|
|
|
description: "Replace to trigger a non-mock run."
|
|
|
|
default: "mock"
|
2021-06-21 05:40:58 +00:00
|
|
|
required: false
|
2021-02-18 06:18:04 +00:00
|
|
|
|
2022-04-29 22:15:49 +00:00
|
|
|
env:
|
|
|
|
CARGO_INCREMENTAL: 0
|
|
|
|
CARGO_PROFILE_DEV_DEBUG: 0
|
|
|
|
|
2021-02-18 06:18:04 +00:00
|
|
|
jobs:
|
2021-10-03 06:42:37 +00:00
|
|
|
initialize-job:
|
|
|
|
name: initialize-job
|
2021-02-18 06:18:04 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-05-13 02:53:18 +00:00
|
|
|
- name: Check if mock
|
2021-05-15 21:20:28 +00:00
|
|
|
run: |
|
|
|
|
echo "${{ github.event.inputs.isMock }}";
|
2021-06-21 23:56:59 +00:00
|
|
|
if [[ -z "${{ github.event.inputs.isMock }}" ]]; then
|
|
|
|
echo "This is a scheduled nightly run."
|
|
|
|
elif [[ "${{ github.event.inputs.isMock }}" == "mock" ]]; then
|
|
|
|
echo "This is a mock run."
|
|
|
|
else
|
2022-06-02 09:10:17 +00:00
|
|
|
echo "This is NOT a mock run. Watch for the generated files!"
|
2021-06-21 23:56:59 +00:00
|
|
|
fi
|
2021-05-13 02:53:18 +00:00
|
|
|
|
2021-02-18 06:18:04 +00:00
|
|
|
build-release:
|
2021-10-03 06:42:37 +00:00
|
|
|
needs: [initialize-job]
|
2022-06-02 09:10:17 +00:00
|
|
|
uses: ./.github/workflows/build_releases.yml
|
2022-10-27 10:27:04 +00:00
|
|
|
with:
|
|
|
|
caller: "nightly"
|
|
|
|
secrets: inherit
|
2021-10-03 06:42:37 +00:00
|
|
|
|
|
|
|
upload-release:
|
|
|
|
name: upload-release
|
|
|
|
runs-on: ubuntu-latest
|
2022-06-02 09:10:17 +00:00
|
|
|
needs: [build-release]
|
2021-10-03 06:42:37 +00:00
|
|
|
steps:
|
|
|
|
- name: Get release artifacts
|
2022-06-02 09:10:17 +00:00
|
|
|
uses: actions/download-artifact@v3
|
2021-10-03 06:42:37 +00:00
|
|
|
with:
|
|
|
|
name: release
|
|
|
|
path: release
|
|
|
|
|
|
|
|
- name: Print out all release files
|
|
|
|
run: |
|
|
|
|
echo "Generated $(ls ./release | wc -l) files:"
|
2022-05-18 23:09:50 +00:00
|
|
|
du -h -d 0 ./release/*
|
2021-10-03 06:42:37 +00:00
|
|
|
|
|
|
|
- name: Delete tag and release
|
2021-12-22 22:29:50 +00:00
|
|
|
uses: dev-drprasad/delete-tag-and-release@085c6969f18bad0de1b9f3fe6692a3cd01f64fe5 # 0.2.0
|
2021-09-23 23:13:13 +00:00
|
|
|
if: github.event.inputs.isMock != 'mock'
|
2021-10-03 06:42:37 +00:00
|
|
|
with:
|
|
|
|
delete_release: true
|
|
|
|
tag_name: nightly
|
2021-02-18 06:18:04 +00:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2021-10-03 06:42:37 +00:00
|
|
|
|
|
|
|
- name: Sleep for a few seconds to prevent timing issues between the deletion and creation of the release
|
|
|
|
run: sleep 10
|
|
|
|
if: github.event.inputs.isMock != 'mock'
|
|
|
|
|
|
|
|
- name: Upload all saved release files if not mock
|
2021-12-22 22:29:50 +00:00
|
|
|
uses: softprops/action-gh-release@17cd0d34deddf848fc0e7d9be5202c148c270a0a # 0.1.14
|
2021-10-03 06:42:37 +00:00
|
|
|
if: github.event.inputs.isMock != 'mock'
|
2021-02-18 06:18:04 +00:00
|
|
|
with:
|
2021-10-03 06:42:37 +00:00
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
prerelease: true
|
|
|
|
tag_name: "nightly"
|
|
|
|
draft: false
|
|
|
|
fail_on_unmatched_files: true
|
|
|
|
files: |
|
|
|
|
./release/*
|