2022-06-02 05:10:17 -04:00
|
|
|
# Creates nightly deployment builds for main targets. Note this does not cover package distribution channels,
|
2021-09-20 01:09:10 -04:00
|
|
|
# such as choco.
|
2021-02-18 01:18:04 -05:00
|
|
|
|
2021-02-18 01:18:53 -05:00
|
|
|
name: nightly
|
2021-02-18 01:18:04 -05:00
|
|
|
|
|
|
|
on:
|
|
|
|
schedule:
|
|
|
|
- cron: "0 0 * * *"
|
|
|
|
workflow_dispatch:
|
2021-05-15 14:20:28 -07:00
|
|
|
inputs:
|
|
|
|
isMock:
|
2022-12-30 00:56:27 -05:00
|
|
|
description: "Replace with any word other than 'mock' to trigger a non-mock run."
|
2021-06-21 16:56:59 -07:00
|
|
|
default: "mock"
|
2021-06-20 22:40:58 -07:00
|
|
|
required: false
|
2021-02-18 01:18:04 -05:00
|
|
|
|
2022-04-29 18:15:49 -04:00
|
|
|
env:
|
|
|
|
CARGO_INCREMENTAL: 0
|
|
|
|
CARGO_PROFILE_DEV_DEBUG: 0
|
2023-03-12 15:43:30 -04:00
|
|
|
CARGO_HUSKY_DONT_INSTALL_HOOKS: true
|
2022-04-29 18:15:49 -04:00
|
|
|
|
2021-02-18 01:18:04 -05:00
|
|
|
jobs:
|
2022-11-04 04:48:44 -04:00
|
|
|
# TODO: Add a pre-job check to skip if no change; may want to add something to check if there is a new rust version/week limit of skips?
|
|
|
|
|
2021-10-03 02:42:37 -04:00
|
|
|
initialize-job:
|
|
|
|
name: initialize-job
|
2021-02-18 01:18:04 -05:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2021-05-12 19:53:18 -07:00
|
|
|
- name: Check if mock
|
2021-05-15 14:20:28 -07:00
|
|
|
run: |
|
|
|
|
echo "${{ github.event.inputs.isMock }}";
|
2021-06-21 16:56:59 -07: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 05:10:17 -04:00
|
|
|
echo "This is NOT a mock run. Watch for the generated files!"
|
2021-06-21 16:56:59 -07:00
|
|
|
fi
|
2021-05-12 19:53:18 -07:00
|
|
|
|
2021-02-18 01:18:04 -05:00
|
|
|
build-release:
|
2021-10-03 02:42:37 -04:00
|
|
|
needs: [initialize-job]
|
2022-06-02 05:10:17 -04:00
|
|
|
uses: ./.github/workflows/build_releases.yml
|
2022-10-27 06:27:04 -04:00
|
|
|
with:
|
|
|
|
caller: "nightly"
|
|
|
|
secrets: inherit
|
2021-10-03 02:42:37 -04:00
|
|
|
|
|
|
|
upload-release:
|
|
|
|
name: upload-release
|
|
|
|
runs-on: ubuntu-latest
|
2022-06-02 05:10:17 -04:00
|
|
|
needs: [build-release]
|
2021-10-03 02:42:37 -04:00
|
|
|
steps:
|
2024-01-28 19:37:31 -05:00
|
|
|
- name: Checkout repository
|
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
|
|
|
with:
|
|
|
|
fetch-depth: 1
|
|
|
|
|
2021-10-03 02:42:37 -04:00
|
|
|
- name: Get release artifacts
|
2024-01-28 18:11:05 -05:00
|
|
|
uses: actions/download-artifact@6b208ae046db98c579e8a3aa621ab581ff575935 # v4.1.1
|
2021-10-03 02:42:37 -04:00
|
|
|
with:
|
2024-01-28 18:11:05 -05:00
|
|
|
pattern: release-*
|
2021-10-03 02:42:37 -04:00
|
|
|
path: release
|
2024-01-28 18:11:05 -05:00
|
|
|
merge-multiple: true
|
2021-10-03 02:42:37 -04:00
|
|
|
|
|
|
|
- name: Print out all release files
|
|
|
|
run: |
|
|
|
|
echo "Generated $(ls ./release | wc -l) files:"
|
2022-05-18 19:09:50 -04:00
|
|
|
du -h -d 0 ./release/*
|
2021-10-03 02:42:37 -04:00
|
|
|
|
2024-01-28 19:37:31 -05:00
|
|
|
- name: Delete tag and release if not mock
|
2021-09-23 19:13:13 -04:00
|
|
|
if: github.event.inputs.isMock != 'mock'
|
2024-01-28 19:37:31 -05:00
|
|
|
run: gh release delete nightly --cleanup-tag
|
2021-02-18 01:18:04 -05:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2021-10-03 02:42:37 -04: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'
|
|
|
|
|
2024-01-28 19:37:31 -05:00
|
|
|
- name: Add all release files and create nightly release if not mock
|
2024-03-09 22:24:14 -05:00
|
|
|
uses: softprops/action-gh-release@20e085ccc73308c2c8e43ab8da4f8d7ecbb94d4e # 2.0.1
|
2021-10-03 02:42:37 -04:00
|
|
|
if: github.event.inputs.isMock != 'mock'
|
2021-02-18 01:18:04 -05:00
|
|
|
with:
|
2021-10-03 02:42:37 -04:00
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
prerelease: true
|
|
|
|
tag_name: "nightly"
|
|
|
|
draft: false
|
|
|
|
fail_on_unmatched_files: true
|
|
|
|
files: |
|
|
|
|
./release/*
|