EMXArms/.forgejo/workflows/zip.yaml

78 lines
2.4 KiB
YAML
Raw Normal View History

2024-07-23 17:08:38 -04:00
name: Actions
on:
push:
branches:
2024-07-23 17:08:58 -04:00
- 'main'
2024-07-23 17:08:38 -04:00
jobs:
Build Gunpack:
runs-on: docker
container: catthehacker/ubuntu:act-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: emxarms
path: |
./*
2024-07-23 17:39:36 -04:00
!.forgejo/
!.git/
2024-07-23 17:08:38 -04:00
Autotagger:
runs-on: docker
container: catthehacker/ubuntu:act-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Git
run: |
git config --global user.name "GalacticFactory"
git config --global user.email "contact@galacticfactory.cc"
- name: Import GPG key
uses: actions/gpg@v4
with:
gpg_private_key : ${{ secrets.GPG_PRIVATE_KEY }}
passphrase : ${{ secrets.GPG_PASSPHRASE }}
- name: Extract commit message
id: extract_commit_message
run: echo "::set-output name=message::$(git log --format=%B -n 1 $GITHUB_SHA)"
- name: Check commit message
id: check_commit_message
run: |
COMMIT_MESSAGE=$(echo "${{ steps.extract_commit_message.outputs.message }}")
OUTPUT=$(python .forgejo/workflows/scripts/message.py "$COMMIT_MESSAGE")
2024-07-23 17:08:38 -04:00
if [ "$OUTPUT" = "Usage: python message.py <commit_message>" ]; then
echo "Called without commit message!"
exit 1
elif [ "$OUTPUT" = "None" ]; then
echo "No version bump."
echo "::set-output name=latest_tag::$(git describe --tags --abbrev=0)"
else
echo "Version bump detected: $OUTPUT"
echo "::set-output name=version::$OUTPUT"
fi
- name: Create tag
if: steps.check_commit_message.outputs.version
run: |
VERSION=${{ steps.check_commit_message.outputs.version }}
git tag -s $VERSION -m "version bumped to $VERSION"
git push origin $VERSION
- name: Update latest tag
if: steps.check_commit_message.outputs.latest_tag
run: |
COMMIT_MESSAGE=$(echo "${{ steps.extract_commit_message.outputs.message }}")
LATEST_TAG=${{ steps.check_commit_message.outputs.latest_tag }}
git tag -fs $LATEST_TAG -m "$COMMIT_MESSAGE"
git push origin $LATEST_TAG --force