Skip to content

Commit a742efc

Browse files
author
Gérard Collin
committed
Better control of releases
1 parent 175e23f commit a742efc

3 files changed

Lines changed: 53 additions & 14 deletions

File tree

.github/workflows/dev-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Development
1+
name: Development Build
22

33
on:
44
push:

.github/workflows/main-build.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Main Build
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
jobs:
8+
build:
9+
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Create mongo Docker container
14+
id: build_mongo_docker
15+
uses: DigiPie/mongo-action@v2.0.1
16+
with:
17+
image_version: latest
18+
port: 27017
19+
- uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
ref: main
23+
24+
- name: Set up JDK 21
25+
uses: actions/setup-java@v4
26+
with:
27+
distribution: 'adopt'
28+
java-version: '21'
29+
- name: Cache Maven repository
30+
uses: actions/cache@v4
31+
with:
32+
path: .m2/repository # maven repository files are stored here
33+
key: ${{ runner.OS }}-maven-${{ hashFiles('pom.xml') }}
34+
- name: Build
35+
run: mvn -B package --file pom.xml
36+
- uses: actions/upload-artifact@v4
37+
# Test run screenshots only on failure
38+
if: success()
39+
with:
40+
name: ide-services-runner.jar
41+
path: target/ide-services-runner.jar

.github/workflows/release.yml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
name: Release
22

33
on:
4-
push:
5-
branches: [ main ]
4+
workflow_dispatch:
5+
inputs:
6+
branch:
7+
description: The branch to release in test
8+
required: false
9+
default: Development
10+
type: choice
11+
options:
12+
- Development
13+
- main
614

715
jobs:
816
build:
@@ -19,8 +27,7 @@ jobs:
1927
- uses: actions/checkout@v4
2028
with:
2129
fetch-depth: 0
22-
ref: main
23-
30+
ref: ${{inputs.branch}}
2431
- name: Set up JDK 21
2532
uses: actions/setup-java@v4
2633
with:
@@ -31,11 +38,6 @@ jobs:
3138
with:
3239
path: .m2/repository # maven repository files are stored here
3340
key: ${{ runner.OS }}-maven-${{ hashFiles('pom.xml') }}
34-
- name: Install
35-
run: |
36-
git config user.name "GitHub Actions"
37-
git config user.email noreply@github.com
38-
git merge origin/Development
3941
- name: Build
4042
run: mvn -B package --file pom.xml
4143
- uses: actions/upload-artifact@v4
@@ -44,10 +46,6 @@ jobs:
4446
with:
4547
name: ide-services-runner.jar
4648
path: target/ide-services-runner.jar
47-
- name: Push
48-
run: |
49-
git commit -a -m "New release" --allow-empty
50-
git push
5149
- name: Deploy to test
5250
uses: appleboy/scp-action@master
5351
with:

0 commit comments

Comments
 (0)