Skip to content

Commit

Permalink
[O] Optimize gh actions
Browse files Browse the repository at this point in the history
  • Loading branch information
hykilpikonna committed Dec 23, 2023
1 parent 41d4de6 commit f64a837
Showing 1 changed file with 5 additions and 21 deletions.
26 changes: 5 additions & 21 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,6 @@ jobs:
- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Manage Version
run: |
git fetch --prune --unshallow --tags
GIT_SHA="$(git rev-parse --short HEAD)"
CUR_TAG="$(git tag -l | grep 'nightly' | tail -1)"
VER="$(sed -n 's/version = "\(.*\)"/\1/p' build.gradle.kts)"
echo "SHORT_SHA=$GIT_SHA" >> $GITHUB_ENV
echo "VER=$VER" >> $GITHUB_ENV
if [[ -z $CUR_TAG ]]; then
echo "OLD_PRE_TAG=NULL" >> $GITHUB_ENV
else
echo "OLD_PRE_TAG=$CUR_TAG" >> $GITHUB_ENV
fi
- name: Build Artifact
run: |
./gradlew build
Expand All @@ -51,11 +37,9 @@ jobs:
echo '### The latest five updates are:' >> ReleaseNotes.md
git log -"5" --format="- %H %s" | sed '/^$/d' >> ReleaseNotes.md
- name: Delete Old Prerelease
if: env.OLD_PRE_TAG != 'NULL'
uses: dev-drprasad/[email protected]
with:
tag_name: ${{ env.OLD_PRE_TAG }}
- name: Delete previous nightly release
run: |
gh release delete --cleanup-tag --yes --repo $GITHUB_REPOSITORY nightly
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -64,12 +48,12 @@ jobs:
with:
bodyFile: ReleaseNotes.md
artifacts: "build/libs/aqua-nightly.jar"
tag: "${{ env.VER }}-nightly"
tag: "nightly"
token: ${{ secrets.GITHUB_TOKEN }}
draft: false

- name: Mark release undraft
run: |
gh release edit "${{ env.VER }}-nightly" --draft=false
gh release edit nightly --draft=false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit f64a837

Please sign in to comment.