Nightly Publish #5
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: Nightly Publish | |
on: | |
schedule: | |
- cron: "0 0 * * *" | |
workflow_dispatch: | |
jobs: | |
tests: | |
if: github.repository_owner == 'openwallet-foundation' || github.event_name == 'workflow_dispatch' | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
os: ["ubuntu-latest"] | |
python-version: ["3.12"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Run Tests | |
uses: ./.github/actions/run-unit-tests | |
with: | |
python-version: ${{ matrix.python-version }} | |
os: ${{ matrix.os }} | |
is_pr: "false" | |
setup_and_check_pub: | |
name: Setup Publish | |
runs-on: ubuntu-latest | |
outputs: | |
commits_today: ${{ steps.commits.outputs.commits_today }} | |
date: ${{ steps.date.outputs.date }} | |
if: github.repository_owner == 'openwallet-foundation' || github.event_name == 'workflow_dispatch' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Print Latest Commit | |
run: echo ${{ github.sha }} | |
- name: Get New Commits | |
id: commits | |
run: echo "commits_today=$(git log --oneline --since '24 hours ago' | wc -l)" >> $GITHUB_OUTPUT | |
- name: Get Date | |
id: date | |
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT | |
publish: | |
name: Publish | |
needs: [tests, setup_and_check_pub] | |
if: needs.setup_and_check_pub.outputs.commits_today > 0 | |
uses: ./.github/workflows/publish.yml | |
strategy: | |
matrix: | |
tag: ["nightly-${{needs.setup_and_check_pub.outputs.date}}", nightly] | |
with: | |
tag: ${{ matrix.tag }} | |
platforms: "linux/amd64,linux/arm64" |