Skip to content

Commit

Permalink
Merge pull request #39 from coolkiid/fix-github-actions
Browse files Browse the repository at this point in the history
[Github Actions] Fix Github Actions
  • Loading branch information
Zzaphkiel authored Sep 12, 2023
2 parents ab2031a + 30096cd commit 945d331
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions .github/workflows/build_seraphine.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Build Seraphine

on:
push:
branches:
- main
pull_request:
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -33,21 +37,28 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup environment variables
run: |
export VERSION=`python -c "from app.common.config import VERSION; print(VERSION)"`
export VERSION_CHANGED_COMMIT_HASH=$(git blame app/common/config.py --root -l | grep -Po "([\w]+) (?=\(.*\) VERSION = )")
export HEAD_COMMIT_HASH=$(git log -1 --format='%H')
export UPDATED=$(python -c "import os; UPDATED = 'true' if os.environ['HEAD_COMMIT_HASH'].strip() == os.environ['VERSION_CHANGED_COMMIT_HASH'].strip() else 'false'; print(UPDATED)")
export VERSION=$(cat app/common/config.py | grep -Po "(?<=VERSION = \")(.*[^\"])")
echo "VERSION=v$VERSION" >> $GITHUB_ENV
echo "UPDATED=$UPDATED" >> $GITHUB_ENV
- name: Download artifact
uses: actions/download-artifact@v3
if: env.UPDATED == 'true'
with:
name: Seraphine
path: ./
- name: Push to release
uses: ncipollo/release-action@v1
if: env.UPDATED == 'true'
with:
name: Seraphine ${{ env.VERSION }}
tag: ${{ env.VERSION }}
omitBodyDuringUpdate: true
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: false
replacesArtifacts: false
artifacts: Seraphine.zip

0 comments on commit 945d331

Please sign in to comment.