-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fdf2fd1
commit 537dbe5
Showing
1 changed file
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,13 @@ name: Release | |
on: | ||
workflow_dispatch: # add manual trigger button | ||
|
||
concurrency: | ||
group: ${{ github.workflow }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
|
@@ -14,19 +21,38 @@ jobs: | |
java-version: 17 | ||
distribution: temurin | ||
|
||
- name: Extract PROJECT_VERSION from gradle.properties | ||
run: | | ||
echo "PROJECT_VERSION=$(grep 'projectVersion=' gradle.properties | cut -d'=' -f2)" >> $GITHUB_ENV | ||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v3 | ||
|
||
- name: Publish | ||
run: | | ||
./gradlew docs:all publish | ||
./gradlew docs:all publish fatJar | ||
env: | ||
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.ORG_GRADLE_PROJECT_signingKeyId }} | ||
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_signingKey }} | ||
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ORG_GRADLE_PROJECT_signingPassword }} | ||
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.ORG_GRADLE_PROJECT_mavenCentralUsername }} | ||
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.ORG_GRADLE_PROJECT_mavenCentralPassword }} | ||
|
||
- name: Release to GitHub | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
git config user.email "[email protected]" | ||
git config user.name "GitHub Action" | ||
git tag "v$PROJECT_VERSION" --force | ||
git push origin "v$PROJECT_VERSION" --force | ||
gh release delete "v$PROJECT_VERSION" --yes || true | ||
gh release create "v$PROJECT_VERSION" \ | ||
--title "v$PROJECT_VERSION" \ | ||
--prerelease \ | ||
--notes "This is the latest pre-release for version $PROJECT_VERSION. Details of the changes can be found in the [CHANGELOG.md](https://github.com/pascal-lab/Tai-e/blob/master/CHANGELOG.md). Please note that this pre-release will be removed once the stable version is officially released, and it may be overridden by newer snapshot versions as they are published." | ||
gh release upload "v$PROJECT_VERSION" ./build/tai-e-all-*.jar | ||
- uses: manyuanrong/[email protected] | ||
with: | ||
endpoint: ${{ secrets.OSS_ACCESS_ENDPOINT }} | ||
|