Skip to content

Nightly Release

Nightly Release #188

Workflow file for this run

name: "Experimental Release"
concurrency: release
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
env:
VCPKG_BINARY_SOURCES: "default"
jobs:
metadata:
runs-on: ubuntu-latest
outputs:
count: ${{ steps.env_vars.outputs.count }}
tag_name: ${{ steps.env_vars.outputs.tag_name }}
release_name: ${{ steps.env_vars.outputs.release_name }}
yesterday_tag_name: ${{ steps.env_vars.outputs.yesterday_tag_name }}
steps:
- uses: actions/checkout@v4
with:
repository: cataclysmbnteam/Cataclysm-BN
- id: env_vars
run: |
TAG_NAME=$(date -u --iso-8601 --date='1 day ago')
YESTERDAY_TAG_NAME=$(date -u --iso-8601 --date='2 day ago')
COMMITS=$(git log --oneline --since="$TAG_NAME" | wc -l)
RELEASE_NAME="Experimental $TAG_NAME"
echo "commits yesterday ($TAG_NAME): $COMMITS" >> "$GITHUB_STEP_SUMMARY"
echo "count=$COMMITS" >> "$GITHUB_OUTPUT"
echo "tag_name=$TAG_NAME" >> "$GITHUB_OUTPUT"
echo "yesterday_tag_name=$YESTERDAY_TAG_NAME" >> "$GITHUB_OUTPUT"
echo "release_name=$RELEASE_NAME" >> "$GITHUB_OUTPUT"
release:
needs: metadata
name: Create Release
runs-on: ubuntu-22.04
if: fromJson(needs.metadata.outputs.count) > 0
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
release_already_exists: ${{ steps.tag_check.outputs.exists }}
steps:
- name: Check if there is existing git tag
id: tag_check
uses: mukunku/tag-exists-action@v1.6.0
with:
tag: ${{ needs.metadata.outputs.tag_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
with:
repository: cataclysmbnteam/Cataclysm-BN
- name: Push tag
if: ${{ steps.tag_check.outputs.exists == 'false' }}
id: tag_version
uses: mathieudutour/github-tag-action@v6.2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: ${{ needs.metadata.outputs.tag_name }}
tag_prefix: ""
- name: Build Changelog
id: build_changelog
uses: mikepenz/release-changelog-builder-action@v4.2.0
with:
configuration: "changelog.json"
fromTag: ${{ needs.metadata.outputs.yesterday_tag_name }}
toTag: ${{ needs.metadata.outputs.tag_name }}
owner: cataclysmbnteam
repo: Cataclysm-BN
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create release
if: ${{ steps.tag_check.outputs.exists == 'false' }}
id: create_release
uses: softprops/action-gh-release@v2.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.metadata.outputs.tag_name }}
name: ${{ needs.metadata.outputs.release_name }}
body: |
${{ steps.build_changelog.outputs.changelog }}
These are the outputs for the experimental build of commit [${{ github.sha }}](https://github.com/${{ github.repository }}/commit/${{ github.sha }})
draft: false
prerelease: true