fix: auto release on mirror updates (#83)
As mentioned in #82, there are issues with having a workflow triggered by the work done by a different workflow. To keep the functionality of the auto release workflow, the two files are being merged into one. Closes #82
This commit is contained in:
parent
4025f7f381
commit
2b6485a44b
28
.github/workflows/main.yml
vendored
28
.github/workflows/main.yml
vendored
@ -32,6 +32,32 @@ jobs:
|
||||
|
||||
- run: python mirror.py
|
||||
|
||||
- run: |
|
||||
- name: check for unpushed commits
|
||||
id: check_unpushed
|
||||
run: |
|
||||
UNPUSHED_COMMITS=$(git log origin/main..HEAD)
|
||||
if [ -z "$UNPUSHED_COMMITS" ]; then
|
||||
echo "No unpushed commits found."
|
||||
echo "changes_exist=false" >> $GITHUB_ENV
|
||||
else
|
||||
echo "Unpushed commits found."
|
||||
echo "changes_exist=true" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: push changes if they exist
|
||||
if: env.changes_exist == 'true'
|
||||
run: |
|
||||
git push origin HEAD:refs/heads/main
|
||||
git push origin HEAD:refs/heads/main --tags
|
||||
|
||||
- name: create release on new tag if new changes exist
|
||||
if: env.changes_exist == 'true'
|
||||
run: |
|
||||
TAG_NAME=$(git describe --tags $(git rev-list --tags --max-count=1))
|
||||
echo $TAG_NAME
|
||||
gh release create "$TAG_NAME" \
|
||||
--title "$TAG_NAME" \
|
||||
--notes "See: https://github.com/astral-sh/uv/releases/tag/$TAG_NAME" \
|
||||
--latest
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
20
.github/workflows/release.yml
vendored
20
.github/workflows/release.yml
vendored
@ -1,20 +0,0 @@
|
||||
name: Releases
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v?[0-9]+.[0-9]+.[0-9]*'
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- run: |
|
||||
TAG_NAME=${GITHUB_REF#refs/tags/}
|
||||
gh release create "$TAG_NAME" \
|
||||
--title "$TAG_NAME" \
|
||||
--notes "See: https://github.com/astral-sh/ruff/releases/tag/$TAG_NAME"
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
Loading…
Reference in New Issue
Block a user