You've already forked Tricky-Addon-Update-Target-List
mirror of
https://github.com/KOWX712/Tricky-Addon-Update-Target-List.git
synced 2025-09-06 06:37:09 +00:00
opt: simplify workflow
This commit is contained in:
22
.github/workflows/build.yml
vendored
22
.github/workflows/build.yml
vendored
@@ -82,23 +82,11 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 2
|
||||
|
||||
- name: Configure Git user
|
||||
run: |
|
||||
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git config --global user.name "github-actions[bot]"
|
||||
|
||||
- name: Create a new tag
|
||||
run: |
|
||||
VERSION=$(grep '^version=' module/module.prop | sed 's/version=//')
|
||||
git tag -a "$VERSION" -m "Release version $VERSION"
|
||||
git push origin "$VERSION"
|
||||
|
||||
- name: Set release variables
|
||||
id: set_release_variables
|
||||
run: |
|
||||
VERSION=$(grep '^version=' module/module.prop | sed 's/version=//')
|
||||
CURRENT_TAG="$VERSION"
|
||||
RELEASE_NOTES=$(awk -v tag="### $CURRENT_TAG" '
|
||||
RELEASE_NOTES=$(awk -v tag="### $VERSION" '
|
||||
$0 == tag {flag=1; next}
|
||||
/^###/ && flag {exit}
|
||||
flag {print}
|
||||
@@ -107,32 +95,28 @@ jobs:
|
||||
if [[ "$VERSION" == *"beta"* ]]; then
|
||||
PRERELEASE=true
|
||||
FORMATTED_RELEASE_NOTES=$(echo -e "- Due to extensive code refactoring, you might encounter unexpected bugs in this version, feedback in [Telegram](https://t.me/kowchannel) or [create issue](https://github.com/KOWX712/Tricky-Addon-Update-Target-List/issues) if you found any issues.\n---\n### Tricky Addon module\n$RELEASE_NOTES")
|
||||
FILES="TrickyAddonModule-${VERSION}.zip"
|
||||
else
|
||||
PRERELEASE=false
|
||||
FORMATTED_RELEASE_NOTES=$(echo -e "### Tricky Addon module\n$RELEASE_NOTES\n")
|
||||
FILES="TrickyAddonModule-${VERSION}.zip"
|
||||
fi
|
||||
|
||||
echo "CURRENT_TAG=$CURRENT_TAG" >> $GITHUB_ENV
|
||||
echo "CURRENT_TAG=$VERSION" >> $GITHUB_ENV
|
||||
echo "ZIP_NAME=TrickyAddonModule-${VERSION}.zip" >> $GITHUB_ENV
|
||||
echo "RELEASE_NOTES<<EOF" >> $GITHUB_ENV
|
||||
echo "$FORMATTED_RELEASE_NOTES" >> $GITHUB_ENV
|
||||
echo "EOF" >> $GITHUB_ENV
|
||||
echo "FILES=$FILES" >> $GITHUB_ENV
|
||||
echo "PRERELEASE=$PRERELEASE" >> $GITHUB_ENV
|
||||
|
||||
- name: Compress module folder
|
||||
run: |
|
||||
cd module && zip -r "../${{ env.ZIP_NAME }}" ./*
|
||||
echo "Created zip file: ${{ env.ZIP_NAME }}"
|
||||
|
||||
- name: Create release
|
||||
uses: softprops/action-gh-release@v2
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
files: ${{ env.FILES }}
|
||||
files: ${{ env.ZIP_NAME }}
|
||||
tag_name: ${{ env.CURRENT_TAG }}
|
||||
name: ${{ env.CURRENT_TAG }}
|
||||
body: ${{ env.RELEASE_NOTES }}
|
||||
|
||||
Reference in New Issue
Block a user