-
Notifications
You must be signed in to change notification settings - Fork 1
77 lines (68 loc) · 2.58 KB
/
Copy pathrelease.yml
File metadata and controls
77 lines (68 loc) · 2.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Release Packages
on:
release:
types: [published]
permissions:
contents: write
jobs:
build-and-upload:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: maven
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: npm
cache-dependency-path: front/package-lock.json
- name: Build backend JAR
working-directory: back
run: mvn -q -pl fsd-bootstrap -am clean package -DskipTests
- name: Build frontend
working-directory: front
env:
VITE_AMAP_KEY: ${{ secrets.VITE_AMAP_KEY }}
VITE_AMAP_SECURITY_CODE: ${{ secrets.VITE_AMAP_SECURITY_CODE }}
run: |
npm ci
npm run build
- name: Assemble release bundle
run: |
VERSION="${{ github.event.release.tag_name }}"
OUT="dist/release/${VERSION}"
mkdir -p "${OUT}/backend" "${OUT}/frontend" "${OUT}/sql/migrations" "${OUT}/deploy"
cp back/fsd-bootstrap/target/fsd-bootstrap-0.1.0-SNAPSHOT.jar "${OUT}/backend/fsd-core-server.jar"
cp -r front/dist/. "${OUT}/frontend/"
cp back/sql/migrations/*.sql "${OUT}/sql/migrations/"
cp back/docker-compose.yml "${OUT}/deploy/docker-compose.yml"
cp back/Dockerfile .env.example "${OUT}/deploy/"
cp docs/DEPLOYMENT.md "${OUT}/"
cp "docs/releases/${VERSION}.md" "${OUT}/RELEASE_NOTES.md" 2>/dev/null || true
cat > "${OUT}/PACKAGE_README.txt" <<EOF
DispatchFlow ${VERSION}
- backend/fsd-core-server.jar
- frontend/ (static)
- sql/migrations/
- deploy/
See DEPLOYMENT.md
EOF
cd dist/release
zip -r "DispatchFlow-${VERSION}-bundle.zip" "${VERSION}"
zip -j "DispatchFlow-${VERSION}-backend.jar.zip" "${VERSION}/backend/fsd-core-server.jar"
(cd "${VERSION}/frontend" && zip -r "../../DispatchFlow-${VERSION}-frontend-dist.zip" .)
- name: Upload to GitHub Release
env:
GH_TOKEN: ${{ github.token }}
run: |
VERSION="${{ github.event.release.tag_name }}"
gh release upload "${VERSION}" \
"dist/release/DispatchFlow-${VERSION}-bundle.zip" \
"dist/release/DispatchFlow-${VERSION}-backend.jar.zip" \
"dist/release/DispatchFlow-${VERSION}-frontend-dist.zip" \
--clobber