github: fix nightly mocking (#481)

Hopefully fixes the mock build capabilities for nightly when testing.
This commit is contained in:
Clement Tsang 2021-05-15 14:20:28 -07:00 committed by GitHub
parent 1eb3d3bc38
commit 3f7f9d2ccc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,6 +7,10 @@ on:
schedule: schedule:
- cron: "0 0 * * *" - cron: "0 0 * * *"
workflow_dispatch: workflow_dispatch:
inputs:
isMock:
description: "Mock nightly run, fill in with anything to trigger a mock build."
default: ""
jobs: jobs:
create-github-release: create-github-release:
@ -17,22 +21,25 @@ jobs:
run: mkdir artifacts run: mkdir artifacts
- name: Check if mock - name: Check if mock
run: echo "github.event.inputs.isMock" run: |
echo "${{ github.event.inputs.isMock }}";
- name: Delete tag and release - name: Delete tag and release
uses: dev-drprasad/delete-tag-and-release@v0.1.3 uses: dev-drprasad/delete-tag-and-release@v0.1.3
if: github.event.inputs.isMock == ''
with: with:
delete_release: true delete_release: true
tag_name: nightly tag_name: nightly
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Sleep for a few seconds to prevent timing issues between the deletion and creation. - name: Sleep for a few seconds to prevent timing issues between the deletion and creation of the release.
run: sleep 10 run: sleep 10
- name: Create nightly GitHub release - name: Create nightly GitHub release
id: release id: release
uses: actions/create-release@v1 uses: actions/create-release@v1
if: github.event.inputs.isMock == ''
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with: with:
@ -216,7 +223,7 @@ jobs:
# TODO: Move this elsewhere; do this all at once, and do not continue if any fails. Store artifacts. Do the same for deployment. # TODO: Move this elsewhere; do this all at once, and do not continue if any fails. Store artifacts. Do the same for deployment.
- name: Upload main release - name: Upload main release
if: if: github.event.inputs.isMock == ''
uses: actions/upload-release-asset@v1.0.1 uses: actions/upload-release-asset@v1.0.1
id: upload id: upload
env: env:
@ -236,7 +243,7 @@ jobs:
cargo wix cargo wix
- name: Upload msi file (Windows x86-64 MSVC) - name: Upload msi file (Windows x86-64 MSVC)
if: matrix.triple.target == 'x86_64-pc-windows-msvc' if: matrix.triple.target == 'x86_64-pc-windows-msvc' && github.event.inputs.isMock == ''
uses: actions/upload-release-asset@v1.0.1 uses: actions/upload-release-asset@v1.0.1
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@ -254,7 +261,7 @@ jobs:
cp ./target/debian/bottom_*.deb ./bottom_${{ env.RELEASE_VERSION }}_amd64.deb cp ./target/debian/bottom_*.deb ./bottom_${{ env.RELEASE_VERSION }}_amd64.deb
- name: Upload Debian file (Linux x86-64 GNU) - name: Upload Debian file (Linux x86-64 GNU)
if: matrix.triple.target == 'x86_64-unknown-linux-gnu' && matrix.triple.container == '' if: matrix.triple.target == 'x86_64-unknown-linux-gnu' && matrix.triple.container == '' && github.event.inputs.isMock == ''
uses: actions/upload-release-asset@v1.0.1 uses: actions/upload-release-asset@v1.0.1
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}