-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci👷(build): publish CI artifact to gitee
- Loading branch information
1 parent
5bdfa67
commit 4a297ce
Showing
1 changed file
with
40 additions
and
0 deletions.
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 |
---|---|---|
|
@@ -29,6 +29,21 @@ jobs: | |
distribution: 'temurin' | ||
java-version: 21 | ||
|
||
- name: Get git info | ||
id: get_git_info | ||
run: | | ||
short_sha=$(echo ${GITHUB_SHA} | cut -c1-7) | ||
commit_count=$(git log | grep -e '^commit [a-zA-Z0-9]*' | wc -l) | ||
echo "short_sha=$short_sha" >> $GITHUB_OUTPUT | ||
echo "commit_count=$commit_count" >> $GITHUB_OUTPUT | ||
- name: Read common properties | ||
id: properties_g | ||
uses: christian-draeger/[email protected] | ||
with: | ||
path: gradle.properties | ||
properties: 'mod_name mod_version' | ||
|
||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v4 | ||
|
||
|
@@ -61,6 +76,31 @@ jobs: | |
name: build-artifacts | ||
path: versions/*/build/libs/ | ||
|
||
- name: Upload gitee CI artifacts | ||
uses: nicennnnnnnlee/[email protected] | ||
with: | ||
gitee_owner: wendavid552 | ||
gitee_repo: Carpet-AMS-Addition | ||
gitee_token: ${{ secrets.GITEE_API_TOKEN }} | ||
gitee_tag_name: ${{ format('{0}.{1}', github.ref_name, steps.get_git_info.outputs.commit_count) }} | ||
gitee_release_name: ${{ format('[CI#{0}]{1} {2}.{3}+{4}', github.run_number, steps.properties_g.outputs.mod_name, steps.properties_g.outputs.mod_version, steps.get_git_info.outputs.commit_count, steps.get_git_info.outputs.short_sha) }} | ||
gitee_release_body: |- | ||
**This version is automatically released by CI Build** | ||
Latest commit log: | ||
${{ github.event.head_commit.message }} | ||
------- | ||
Build Information | ||
- Built from: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | ||
gitee_target_commitish: ${{ github.sha }} | ||
gitee_upload_retry_times: 3 | ||
gitee_files: | | ||
build-artifacts/*/build/libs/!(*-@(dev|sources|shadow)).jar | ||
summary: | ||
runs-on: ubuntu-22.04 | ||
needs: | ||
|