Skip to content

Commit d09999a

Browse files
authored
replace set-env with new gh API (#120)
1 parent a56c2ea commit d09999a

File tree

4 files changed

+31
-28
lines changed

4 files changed

+31
-28
lines changed

.github/workflows/gradle-all.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121

2222
steps:
2323
- uses: actions/checkout@v2
24-
- name: Set up JDK
24+
- name: Set up JDK 11
2525
uses: actions/setup-java@v1
2626
with:
2727
java-version: 11
@@ -33,7 +33,8 @@ jobs:
3333
~/.konan
3434
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.*') }} #hash based on *.gradle.kts and *.gradle.properties
3535
restore-keys: ${{ runner.os }}-gradle
36-
- uses: eskatos/gradle-command-action@v1
36+
- name: Build and run tests
37+
uses: eskatos/gradle-command-action@v1
3738
with:
3839
arguments: build -PmacTargetsCompilation=${{ matrix.macTargetsCompilation }} --scan --no-daemon
3940

@@ -47,7 +48,7 @@ jobs:
4748

4849
steps:
4950
- uses: actions/checkout@v2
50-
- name: Set up JDK
51+
- name: Set up JDK 11
5152
uses: actions/setup-java@v1
5253
with:
5354
java-version: 11
@@ -59,10 +60,10 @@ jobs:
5960
~/.konan
6061
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.*') }} #hash based on *.gradle.kts and *.gradle.properties
6162
restore-keys: ${{ runner.os }}-gradle
62-
- if: ${{ matrix.os == 'windows-latest' }}
63-
run: echo ("::set-env name=BRANCH_NAME::" + $env:GITHUB_REF.replace('refs/heads/', ''))
64-
- if: ${{ matrix.os != 'windows-latest' }}
65-
run: echo "##[set-env name=BRANCH_NAME;]$(echo ${GITHUB_REF#refs/heads/})"
66-
- uses: eskatos/gradle-command-action@v1
63+
- name: Set BRANCH_NAME for publication
64+
run: echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
65+
shell: bash
66+
- name: Publish Packages to Artifactory (version x.y.z-${{ env.BRANCH_NAME }}-SNAPSHOT)
67+
uses: eskatos/gradle-command-action@v1
6768
with:
6869
arguments: artifactoryPublish -PbintrayUser=${{ secrets.bintrayUser }} -PbintrayKey=${{ secrets.bintrayKey }} -PversionSuffix=-${{ env.BRANCH_NAME }}-SNAPSHOT -PbuildNumber=${{ github.run_number }} --stacktrace --no-daemon

.github/workflows/gradle-main.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121

2222
steps:
2323
- uses: actions/checkout@v2
24-
- name: Set up JDK
24+
- name: Set up JDK 11
2525
uses: actions/setup-java@v1
2626
with:
2727
java-version: 11
@@ -33,7 +33,8 @@ jobs:
3333
~/.konan
3434
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.*') }} #hash based on *.gradle.kts and *.gradle.properties
3535
restore-keys: ${{ runner.os }}-gradle
36-
- uses: eskatos/gradle-command-action@v1
36+
- name: Build and run tests
37+
uses: eskatos/gradle-command-action@v1
3738
with:
3839
arguments: build -PmacTargetsCompilation=${{ matrix.macTargetsCompilation }} --scan --no-daemon
3940

@@ -47,7 +48,7 @@ jobs:
4748

4849
steps:
4950
- uses: actions/checkout@v2
50-
- name: Set up JDK
51+
- name: Set up JDK 11
5152
uses: actions/setup-java@v1
5253
with:
5354
java-version: 11
@@ -59,6 +60,7 @@ jobs:
5960
~/.konan
6061
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.*') }} #hash based on *.gradle.kts and *.gradle.properties
6162
restore-keys: ${{ runner.os }}-gradle
62-
- uses: eskatos/gradle-command-action@v1
63+
- name: Publish Packages to Artifactory (version x.y.z-SNAPSHOT)
64+
uses: eskatos/gradle-command-action@v1
6365
with:
6466
arguments: artifactoryPublish -PbintrayUser=${{ secrets.bintrayUser }} -PbintrayKey=${{ secrets.bintrayKey }} -PversionSuffix=-SNAPSHOT -PbuildNumber=${{ github.run_number }} --stacktrace --no-daemon

.github/workflows/gradle-pr.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
steps:
1818
- uses: actions/checkout@v2
19-
- name: Set up JDK
19+
- name: Set up JDK 11
2020
uses: actions/setup-java@v1
2121
with:
2222
java-version: 11
@@ -28,6 +28,7 @@ jobs:
2828
~/.konan
2929
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.*') }} #hash based on *.gradle.kts and *.gradle.properties
3030
restore-keys: ${{ runner.os }}-gradle
31-
- uses: eskatos/gradle-command-action@v1
31+
- name: Build and run tests
32+
uses: eskatos/gradle-command-action@v1
3233
with:
3334
arguments: build -PmacTargetsCompilation=${{ matrix.macTargetsCompilation }} --scan --no-daemon

.github/workflows/gradle-release.yml

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121

2222
steps:
2323
- uses: actions/checkout@v2
24-
- name: Set up JDK
24+
- name: Set up JDK 11
2525
uses: actions/setup-java@v1
2626
with:
2727
java-version: 11
@@ -33,7 +33,8 @@ jobs:
3333
~/.konan
3434
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.*') }} #hash based on *.gradle.kts and *.gradle.properties
3535
restore-keys: ${{ runner.os }}-gradle
36-
- uses: eskatos/gradle-command-action@v1
36+
- name: Build and run tests
37+
uses: eskatos/gradle-command-action@v1
3738
with:
3839
arguments: build -PmacTargetsCompilation=${{ matrix.macTargetsCompilation }} --scan --no-daemon
3940

@@ -47,7 +48,7 @@ jobs:
4748

4849
steps:
4950
- uses: actions/checkout@v2
50-
- name: Set up JDK
51+
- name: Set up JDK 11
5152
uses: actions/setup-java@v1
5253
with:
5354
java-version: 11
@@ -59,11 +60,10 @@ jobs:
5960
~/.konan
6061
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.*') }} #hash based on *.gradle.kts and *.gradle.properties
6162
restore-keys: ${{ runner.os }}-gradle
62-
- if: ${{ matrix.os == 'windows-latest' }}
63-
run: echo ("::set-env name=TAG_NAME::" + $env:GITHUB_REF.replace('refs/tags/', ''))
64-
- if: ${{ matrix.os != 'windows-latest' }}
65-
run: echo "##[set-env name=TAG_NAME;]$(echo ${GITHUB_REF#refs/tags/})"
66-
- name: Publish Packages to Bintray
63+
- name: Set TAG_NAME for publication
64+
run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
65+
shell: bash
66+
- name: Publish Packages to Bintray + JCenter (version ${{ env.TAG_NAME }})
6767
uses: eskatos/gradle-command-action@v1
6868
with:
6969
arguments: bintrayUpload -PbintrayUser=${{ secrets.bintrayUser }} -PbintrayKey=${{ secrets.bintrayKey }} -PsonatypeUsername=${{ secrets.sonatypeUsername }} -PsonatypePassword=${{ secrets.sonatypePassword }} -Pversion=${{ env.TAG_NAME }} -PbuildNumber=${{ github.run_number }} --stacktrace --no-daemon
@@ -78,7 +78,7 @@ jobs:
7878

7979
steps:
8080
- uses: actions/checkout@v2
81-
- name: Set up JDK
81+
- name: Set up JDK 11
8282
uses: actions/setup-java@v1
8383
with:
8484
java-version: 11
@@ -90,11 +90,10 @@ jobs:
9090
~/.konan
9191
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.*') }} #hash based on *.gradle.kts and *.gradle.properties
9292
restore-keys: ${{ runner.os }}-gradle
93-
- if: ${{ matrix.os == 'windows-latest' }}
94-
run: echo ("::set-env name=TAG_NAME::" + $env:GITHUB_REF.replace('refs/tags/', ''))
95-
- if: ${{ matrix.os != 'windows-latest' }}
96-
run: echo "##[set-env name=TAG_NAME;]$(echo ${GITHUB_REF#refs/tags/})"
97-
- name: Publish Packages to Bintray
93+
- name: Set TAG_NAME for publication
94+
run: echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
95+
shell: bash
96+
- name: Check that packages are published to JCenter (version ${{ env.TAG_NAME }})
9897
uses: eskatos/gradle-command-action@v1
9998
with:
10099
arguments: publish-check:build -PpublishCheckVersion=${{ env.TAG_NAME }} --info --no-daemon

0 commit comments

Comments
 (0)