Skip to content

Commit

Permalink
ci👷(build): publish CI artifact to gitee
Browse files Browse the repository at this point in the history
  • Loading branch information
wendavid552 committed Sep 22, 2024
1 parent 5bdfa67 commit 0a017cb
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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_SECRET }}
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:
Expand Down

0 comments on commit 0a017cb

Please sign in to comment.