Skip to content

Store symbolic links #11

Store symbolic links

Store symbolic links #11

name: Build, Commit, and Release
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build-and-commit:
runs-on: macos-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Check Commit Message
run: |
commit_message=$(git log -1 --pretty=%B)
if [[ $commit_message == "Chore:"* ]]; then
echo "Commit starts with 'Chore:', skipping workflow."
exit 78
fi
- name: Run Build Script
run: |
chmod +x ./tools/build_language_framework.sh
./tools/build_language_framework.sh --debug
- name: Configure Git
run: |
git config --global user.name 'aurora-care-bear'
git config --global user.email '[email protected]'
- name: Commit Changes
run: |
git add .
git commit -m "Chore: Update [$(git branch --show-current)] - $(date)"
- name: Push Changes
run: git push origin $(git branch --show-current)
env:
GITHUB_TOKEN: $BOT_TOKEN
create-release:
needs: build-and-commit
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Configure Git
run: |
git config --global user.name 'aurora-care-bear'
git config --global user.email '[email protected]'
- name: Fetch Tags
run: git fetch --tags
- name: Check for Latest Tag
id: latesttag
run: |
TAG=$(git describe --tags `git rev-list --tags --max-count=1` 2> /dev/null || echo "")
echo "::set-output name=tag::$TAG"
- name: Generate Release Notes
id: release-notes
run: |
LATEST_TAG=${{ steps.latesttag.outputs.tag }}
if [ -z "$LATEST_TAG" ]; then
# No tags found, use the first commit
LATEST_TAG=$(git rev-list --max-parents=0 HEAD)
fi
COMMIT_LOG=$(git log $LATEST_TAG..HEAD --pretty=format:"%h - %s")
echo "::set-output name=notes::$COMMIT_LOG"
- name: Create Tag
run: |
NEW_TAG="v$(date +'%Y.%m.%d')-$(git rev-parse --short HEAD)"
git tag $NEW_TAG
git push origin $NEW_TAG
echo "NEW_TAG=$NEW_TAG" >> $GITHUB_ENV
- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.NEW_TAG }}
release_name: Release ${{ env.NEW_TAG }}
body: ${{ steps.release-notes.outputs.notes }}
draft: false
prerelease: false