Skip to content

Commit 11f342c

Browse files
committed
Adjust workflows
1 parent ce0fda8 commit 11f342c

File tree

3 files changed

+21
-18
lines changed

3 files changed

+21
-18
lines changed
Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
name: Build executables
1+
name: Build and release
22

33
on:
4+
release:
5+
types: [created]
46
push:
57
branches:
68
- 'master'
@@ -11,9 +13,6 @@ concurrency:
1113
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
1214
cancel-in-progress: true
1315

14-
env:
15-
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
16-
1716
jobs:
1817
build-jar:
1918
name: "Build JAR"
@@ -30,12 +29,20 @@ jobs:
3029
- name: "Build JAR"
3130
run: mvn -DskipTests -Pfatjar clean package
3231
- name: 'Get version'
33-
run: echo "::set-env name=VERSION::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)"
32+
run: echo "VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
3433
- name: 'Upload artifact'
3534
uses: actions/upload-artifact@v4
3635
with:
3736
name: 'simplelocalize-cli-${{env.VERSION}}.jar'
3837
path: 'target/simplelocalize-cli-${{env.VERSION}}.jar'
38+
- name: 'Upload JAR to Release'
39+
if: github.event_name == 'release'
40+
uses: softprops/action-gh-release@v1
41+
with:
42+
files: 'target/simplelocalize-cli-${{env.VERSION}}.jar'
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
3946
build-executable:
4047
name: "Build ${{ matrix.label }} executable"
4148
strategy:
@@ -85,3 +92,10 @@ jobs:
8592
with:
8693
name: simplelocalize-cli-${{ matrix.label }}
8794
path: ./target/${{ matrix.downloadFilename }}
95+
- name: 'Upload Executable to Release'
96+
if: github.event_name == 'release'
97+
uses: softprops/action-gh-release@v1
98+
with:
99+
files: './target/${{ matrix.downloadFilename }}'
100+
env:
101+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/run-tests.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ concurrency:
1010
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
1111
cancel-in-progress: true
1212

13-
env:
14-
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
15-
1613
jobs:
1714
run_tests:
1815
name: "Run tests"
@@ -36,8 +33,3 @@ jobs:
3633
restore-keys: ${{ runner.os }}-sonar
3734
- name: "Test with Maven"
3835
run: mvn --settings .maven.xml clean install -B -V
39-
# - name: "SonarCloud Analyze"
40-
# env:
41-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42-
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
43-
# run: mvn clean -B verify -Ptest org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
name: Install and execute
1+
name: Test executables
22

33
on:
4-
push:
5-
branches:
6-
- 'master'
74
release:
85
types: [published]
96
schedule:
@@ -21,7 +18,7 @@ jobs:
2118
fail-fast: false
2219
matrix:
2320
os: [ macos-11, macos-12, macos-13, ubuntu-22.04 ]
24-
version: [ '2.5', '2.4', '2.3', '2.2' ]
21+
version: [ '2.9', '2.8', '2.7', '2.6' ]
2522
steps:
2623
- uses: actions/checkout@v3
2724
- name: Test on ${{ matrix.os }}

0 commit comments

Comments
 (0)