diff --git a/.env b/.env
index eeb4b5d..7d79fe1 100644
--- a/.env
+++ b/.env
@@ -21,7 +21,7 @@ GCS_SPRING_MAPPING_PORT=8080
# Make sure GCS_SSH_MAPPING_PORT and GCS_SPRING_MAPPING_PORT could be
# accessed by others
POSTGRES_MAPPING_PATH=/var/gcs/postgres
-TARGET_JAR_PATH=./target/gcs-0.1.0-SNAPSHOT.jar
+TARGET_JAR_PATH=./target/gcs-back-end.jar
# NOTE:
# In most situations, you do not need to update those
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..fd3a919
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -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/setup-maven-action@v1.18.0
+ 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
diff --git a/pom.xml b/pom.xml
index 3a86795..2dae86f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -10,7 +10,7 @@
edu.cmipt
gcs
- 0.1.0-SNAPSHOT
+ 0.1.0
gcs
The back end of git center server
@@ -145,6 +145,7 @@
+ gcs-back-end
org.springframework.boot