📩 Self-Update #619
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: '📩 Self-Update' | |
on: | |
# Allow developer to trigger an automatic self-update, if needed. | |
workflow_dispatch: | |
# Once a day, check to see if there have been changes to the template project. | |
schedule: | |
# Since our package template updates automatically, this ensures it will | |
# never be unreleased for more than a day. | |
- cron: 0 0 * * * # end of every day | |
jobs: | |
self_update: | |
name: '📩 Self-Update' | |
runs-on: ubuntu-latest | |
outputs: | |
changed: ${{ steps.changes.outputs.changed }} | |
steps: | |
- name: '🧾 Checkout' | |
uses: actions/checkout@v3 | |
with: | |
submodules: 'recursive' | |
lfs: true | |
token: ${{ secrets.GH_BASIC }} | |
ref: ${{ github.ref }} | |
- name: '🌏 Update Submodules' | |
run: | | |
git pull --recurse-submodules | |
git submodule update --remote --recursive | |
- name: '👀 See If Anything Changed' | |
id: changes | |
run: | | |
if [[ $(git status --porcelain) ]]; then | |
echo "Detected changes in repository." | |
echo "changed=1" >> $GITHUB_OUTPUT | |
else | |
echo "No changes in repository." | |
echo "changed=0" >> $GITHUB_OUTPUT | |
fi | |
release: | |
uses: './.github/workflows/release.yaml' | |
needs: self_update | |
if: needs.self_update.outputs.changed == 1 | |
secrets: | |
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} | |
GH_BASIC: ${{ secrets.GH_BASIC }} | |
with: | |
bump: patch |