Nightly Dev Release #628
This file contains hidden or 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
| # https://github.com/marketplace/actions/automatic-releases | |
| name: Nightly Dev Release | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| on: | |
| schedule: | |
| # every day at 1:44 am | |
| - cron: '44 1 * * *' | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| jobs: | |
| dev-release: | |
| runs-on: ubuntu-latest | |
| env: | |
| DEVMD_SINCE: "2024-08-09" # optional fixed start date | |
| TAG_NAME: "dev" # reuse the same tag each night | |
| RELEASE_TITLE: "Dev Nightly" | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Generate dev notes | |
| run: | | |
| ci/update-devmd.sh | |
| # (Optional) Only extract the auto section between markers for the release body | |
| - name: Extract release body from dev.md markers | |
| id: notes | |
| run: | | |
| awk '/<!-- AUTO-DEVMD:START -->/{f=1;print;next} /<!-- AUTO-DEVMD:END -->/{print;f=0} f' releases/dev.md > /tmp/release_notes.md | |
| # Fallback to entire file if markers missing or empty | |
| if [ ! -s /tmp/release_notes.md ]; then | |
| cp releases/dev.md /tmp/release_notes.md | |
| fi | |
| - name: Create or move tag to current commit | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git tag -f "${TAG_NAME}" "${GITHUB_SHA}" | |
| git push --force origin "refs/tags/${TAG_NAME}" | |
| - name: Delete existing release (if any) | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh release view "${TAG_NAME}" >/dev/null 2>&1 && \ | |
| gh release delete "${TAG_NAME}" -y || \ | |
| echo "No existing release to delete" | |
| - name: Create/Update release | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| tag: ${{ env.TAG_NAME }} | |
| name: ${{ env.RELEASE_TITLE }} | |
| # If the tag didn’t exist the very first time, this tells the action | |
| # what commit to use to create it (safe to keep even after creation): | |
| commit: ${{ github.sha }} | |
| bodyFile: /tmp/release_notes.md | |
| prerelease: true | |
| allowUpdates: true | |
| artifactErrorsFailBuild: false |