Skip to content

Create Release #79

Create Release

Create Release #79

name: Create Release
on:
workflow_dispatch: # Allows manual triggering of the workflow
schedule:
- cron: '0 0 * * *' # Runs every day at midnight UTC
jobs:
create-release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all tags and branches
- name: Get current date
id: date
run: echo "RELEASE_TAG=$(date +'%m-%d-%y')" >> $GITHUB_ENV
- name: Create GitHub Release with timestamp
env:
GITHUB_TOKEN: ${{ secrets.YSYX_DOCS_CONTENT_TOKEN }}
RELEASE_TAG: ${{ env.RELEASE_TAG }}
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GITHUB_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ github.repository }}/releases \
-d '{
"tag_name": "'"$RELEASE_TAG"'",
"target_commitish": "main",
"name": "'"$RELEASE_TAG"'",
"body": "Nightly Release",
"draft": false,
"prerelease": false,
"generate_release_notes": true
}'
- name: Create or update "latest" tag
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git tag -f latest
git push origin :refs/tags/latest
git push origin latest
- name: Create GitHub Release with "latest" tag
env:
GITHUB_TOKEN: ${{ secrets.YSYX_DOCS_CONTENT_TOKEN }}
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GITHUB_TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ github.repository }}/releases \
-d '{
"tag_name": "latest",
"target_commitish": "main",
"name": "Latest Release",
"body": "Latest Nightly Release",
"draft": false,
"prerelease": false,
"generate_release_notes": true
}'