-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #122 from CMIPT/workflow-release
Release workflow
- Loading branch information
Showing
3 changed files
with
63 additions
and
2 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
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 |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
|
||
jobs: | ||
build: | ||
name: Build as a tar.gz | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
steps: | ||
- name: Setup jdk17 and maven | ||
uses: s4u/[email protected] | ||
with: | ||
java-version: 17 | ||
checkout-submodules: true | ||
|
||
- name: Build jar package | ||
run: mvn clean package -Dmaven.test.skip=true | ||
|
||
- name: Get latest tar from gcs-front-end | ||
run: curl -L https://github.com/CMIPT/gcs-front-end/releases/latest/download/gcs-front-end.tar.gz -o gcs-front-end.tar.gz | ||
|
||
- name: Extract gcs-front-end | ||
run: tar -xzf gcs-front-end.tar.gz | ||
|
||
- name: Tar as a gcs.tar.gz | ||
run: tar -czf gcs.tar.gz target/gcs-back-end.jar .env Dockerfile docker-compose.yml 3rdparty/gitolite .output database/init | ||
|
||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: gcs | ||
path: gcs.tar.gz | ||
|
||
release: | ||
name: Release to GitHub | ||
needs: build | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: gcs | ||
|
||
- name: Upload release asset | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
name: ${{ github.ref_name }} | ||
tag_name: ${{ github.ref_name }} | ||
token: ${{ github.token }} | ||
files: gcs.tar.gz | ||
draft: false | ||
prerelease: false | ||
generate_release_notes: true |
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