-
Notifications
You must be signed in to change notification settings - Fork 1
82 lines (74 loc) · 2.72 KB
/
build.yml
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
78
79
80
81
82
name: build
on: [ pull_request, push ]
jobs:
build:
strategy:
matrix:
java: [ 17 ]
os: [ ubuntu-24.04 ]
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'ci skip')"
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Validate gradle wrapper
uses: gradle/actions/wrapper-validation@v3
- name: Setup java ${{ matrix.java }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: temurin
cache: gradle
- name: Build
run: ./gradlew build
- name: capture fabric build artifacts
uses: actions/upload-artifact@v4
with:
name: StackDeobfuscator-Fabric-Artifacts
path: build/libs/StackDeobfuscatorFabric-*
if-no-files-found: error
- name: capture web build artifacts
uses: actions/upload-artifact@v4
with:
name: StackDeobfuscator-Web-Artifacts
path: build/libs/StackDeobfuscatorWeb-*
if-no-files-found: error
deploy_web:
needs: build
strategy:
matrix:
os: [ ubuntu-24.04 ]
runs-on: ${{ matrix.os }}
if: ${{ github.ref == 'refs/heads/master' }}
steps:
- name: Download web artifact
uses: actions/download-artifact@v4
with:
name: StackDeobfuscator-Web-Artifacts
- name: Extract web artifact file name
id: name_finder
run: |
echo -n 'file_name=' >> "$GITHUB_OUTPUT" && ls . | grep all.jar >> "$GITHUB_OUTPUT"
- name: Deploy web
uses: burnett01/rsync-deployments@7.0.1
env:
INPUT_CENSOR_HOSTNAME: "${{ secrets.DEPLOY_SERVER_CENSOR }}"
with:
switches: -av --delete
path: "${{ steps.name_finder.outputs.file_name }}"
remote_user: "${{ secrets.DEPLOY_USER }}"
remote_host: "${{ secrets.DEPLOY_SERVER }}"
remote_key: "${{ secrets.DEPLOY_PRIVATE_KEY }}"
remote_path: "${{ secrets.DEPLOY_PATH }}"
- name: Trigger deploy hook
env:
INPUT_REMOTE_KEY: "${{ secrets.DEPLOY_PRIVATE_KEY }}"
INPUT_REMOTE_USER: "${{ secrets.DEPLOY_USER }}"
INPUT_REMOTE_HOST: "${{ secrets.DEPLOY_SERVER }}"
INPUT_REMOTE_TRIGGER_SCRIPT: "${{ secrets.DEPLOY_SCRIPT }}"
INPUT_PATH: "${{ steps.name_finder.outputs.file_name }}"
run: |
echo "$INPUT_REMOTE_KEY" > privkey
chmod 700 privkey
ssh -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -i privkey -- "$INPUT_REMOTE_USER"@"$INPUT_REMOTE_HOST" "$INPUT_REMOTE_TRIGGER_SCRIPT" "$INPUT_PATH"
rm -f privkey