Create Nightly Release #674
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
name: Create Nightly Release | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * *' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
env: | |
CARGO_TERM_COLOR: always | |
REGISTRY: ghcr.io | |
jobs: | |
create-release: | |
runs-on: ubuntu-latest | |
name: Create release | |
outputs: | |
upload_url: ${{ steps.create-release.outputs.upload_url }} | |
today: ${{ steps.set-date.outputs.today }} | |
release_name: ${{ steps.set-name.outputs.release_name }} | |
steps: | |
- name: Set current date | |
id: set-date | |
run: | | |
TODAY=$(date +'%Y%m%d') | |
echo "::set-output name=today::$TODAY" | |
- name: Set name | |
id: set-name | |
run: | | |
TODAY_HYPHENATED=$(date +'%Y-%m-%d') | |
echo "::set-output name=today::$TODAY" | |
NAME=nightly-${{ steps.set-date.outputs.today }} | |
echo "::set-output name=release_name::$NAME" | |
- name: Checkout sources | |
uses: actions/checkout@v3 | |
with: | |
path: scripts | |
- name: Create Release | |
id: create-release | |
uses: ncipollo/release-action@v1 | |
with: | |
name: ${{ steps.set-name.outputs.release_name }} | |
tag: ${{ steps.set-name.outputs.release_name }} | |
allowUpdates: true | |
removeArtifacts: true | |
draft: false | |
token: ${{ secrets.GITHUB_TOKEN }} | |
release-forc: | |
needs: create-release | |
uses: ./.github/workflows/nightly-forc-release.yml | |
with: | |
upload_url: ${{ needs.create-release.outputs.upload_url }} | |
date: ${{ needs.create-release.outputs.today }} | |
release-fuel-core: | |
needs: create-release | |
uses: ./.github/workflows/nightly-fuel-core-release.yml | |
with: | |
upload_url: ${{ needs.create-release.outputs.upload_url }} | |
date: ${{ needs.create-release.outputs.today }} | |
release-forc-explorer: | |
needs: create-release | |
uses: ./.github/workflows/nightly-forc-explorer-release.yml | |
with: | |
upload_url: ${{ needs.create-release.outputs.upload_url }} | |
date: ${{ needs.create-release.outputs.today }} | |
release-forc-wallet: | |
needs: create-release | |
uses: ./.github/workflows/nightly-forc-wallet-release.yml | |
with: | |
upload_url: ${{ needs.create-release.outputs.upload_url }} | |
date: ${{ needs.create-release.outputs.today }} | |
# Wait for results of called workflows | |
monitor-release-status: | |
needs: [ create-release, release-forc, release-fuel-core, release-forc-explorer, release-forc-wallet ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Ensure release-forc succeeded | |
run: | | |
if [ "${{ needs.create-release.result }}" != "success" ] || \ | |
[ "${{ needs.release-forc.result }}" != "success" ] || \ | |
[ "${{ needs.release-fuel-core.result }}" != "success" ] || \ | |
[ "${{ needs.release-forc-explorer.result }}" != "success" ] || \ | |
[ "${{ needs.release-forc-wallet.result }}" != "success" ]; then | |
echo "Workflow failed. Exiting..." | |
exit 1 | |
else | |
echo "All workflows succeeded." | |
exit 0 | |
fi | |
- name: Notify if Job Fails | |
uses: ravsamhq/notify-slack-action@v1 | |
with: | |
status: ${{ job.status }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
notification_title: "{workflow} has {status_message}" | |
message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}> : <{run_url}|View Run Results>" | |
footer: "" | |
notify_when: "failure" | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_TOOLING }} |