forked from PhantomBot/PhantomBot
-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (93 loc) · 2.95 KB
/
Copy pathedge.yml
File metadata and controls
93 lines (93 loc) · 2.95 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
name: Build/Upload Edge
on:
push:
branches:
- 'edge'
- 'edge-*'
jobs:
buildtest:
name: Test Build on ubuntu-latest with JDK 17
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v6
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: 17
- name: Set up Ant
run: sudo apt-get install ant
- name: Build with Ant
run: ant -noinput -buildfile build.xml test
dockertest:
name: Docker test on ubuntu-latest with JDK 17
runs-on: ubuntu-latest
needs: buildtest
timeout-minutes: 5
services:
registry:
image: registry:2
ports:
- 5000:5000
steps:
- name: Checkout Repository
uses: actions/checkout@v6
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
with:
platforms: linux/amd64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
with:
version: latest
driver-opts: network=host
- name: Build Docker
uses: docker/build-push-action@v7
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
push: true
cache-from: type=gha,scope=master
build-args: |
PROJECT_VERSION=0.0.0
ANT_ARGS=-Dbuildtype=test -Dversion=0.0.0
tags: localhost:5000/tester/phantombot:test
- name: Test with Docker
run: docker run --rm --name phantombot localhost:5000/tester/phantombot:test launch-docker.sh --version
build:
name: Build and upload on ubuntu-latest with JDK 17
runs-on: ubuntu-latest
needs: [buildtest, dockertest]
steps:
- name: Checkout Repository
uses: actions/checkout@v6
- name: Set up JDK 17
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: 17
- name: Set up Ant
run: sudo apt-get install ant
- name: Set up environment variables
id: build_env
run: echo "branch=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT
- name: Prep Ant script
env:
BRANCH: ${{ steps.build_env.outputs.branch }}
run: |
sed -i -r 's/revision="[A-Za-z0-9._-]+"/revision="'$BRANCH'"/;s/branch="[A-Za-z0-9._-]+"/branch="'$BRANCH'"/' ivy.xml
echo $?
- name: Build with Ant
env:
BUILDTYPE: ${{ format('{0}', steps.build_env.outputs.branch) }}
ROLLBAR_TOKEN: ${{ secrets.ROLLBAR_TOKEN }}
ROLLBAR_ENDPOINT: ${{ secrets.ROLLBAR_ENDPOINT }}
BRANCH: ${{ steps.build_env.outputs.branch }}
run: ant -noinput -Dversion=$BRANCH -Dbuildtype=$BUILDTYPE -Drollbar_token=$ROLLBAR_TOKEN -Drollbar_endpoint=$ROLLBAR_ENDPOINT -buildfile build.xml dist
- name: Upload Artifact
uses: actions/upload-artifact@v7
with:
name: ${{ format('PhantomBot-{0}', steps.build_env.outputs.branch) }}
path: ${{ format('dist/PhantomBot-{0}', steps.build_env.outputs.branch) }}