Skip to content

Commit a90800d

Browse files
authored
Merge pull request #1486 from swagger-api/replace-ghactions-set-env
automation - replace deprecated set-env in workflows
2 parents 8e6a1b3 + 3f03bbd commit a90800d

File tree

6 files changed

+146
-146
lines changed

6 files changed

+146
-146
lines changed

.github/workflows/next-snapshot-v1.yml

Lines changed: 64 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -10,70 +10,70 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- uses: actions/checkout@v2
14-
- uses: tibdex/github-app-token@v1
15-
id: generate-token
16-
with:
17-
app_id: ${{ secrets.APP_ID }}
18-
private_key: ${{ secrets.APP_PRIVATE_KEY }}
19-
- name: Set up Python 2.7
20-
uses: actions/setup-python@v2
21-
with:
22-
python-version: 2.7
23-
- name: Set up Java 8
24-
uses: actions/setup-java@v1
25-
with:
26-
java-version: 8
27-
server-id: ossrh
28-
server-username: MAVEN_USERNAME
29-
server-password: MAVEN_PASSWORD
30-
- name: Cache local Maven repository
31-
uses: actions/cache@v2
32-
with:
33-
path: ~/.m2/repository
34-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
35-
restore-keys: |
36-
${{ runner.os }}-maven-
37-
- name: Run pre release script
38-
id: preRelease
39-
run: |
40-
# export GPG_TTY=$(tty)
41-
export MY_POM_VERSION=`mvn -q -Dexec.executable="echo" -Dexec.args='${projects.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec`
42-
if [[ $MY_POM_VERSION =~ ^.*SNAPSHOT$ ]];
43-
then
44-
echo "not releasing snapshot version: " ${MY_POM_VERSION}
45-
echo "::set-env name=RELEASE_OK::no"
46-
else
47-
. ./CI/pre-release-v1.sh
48-
echo "::set-env name=RELEASE_OK::yes"
49-
fi
50-
echo "::set-env name=SC_VERSION::$SC_VERSION"
51-
echo "::set-env name=SC_NEXT_VERSION::$SC_NEXT_VERSION"
52-
echo "::set-env name=SC_LAST_RELEASE::$SC_LAST_RELEASE"
53-
- name: configure git user email
54-
run: |
55-
git config --global user.email "[email protected]"
56-
git config --global user.name "GitHub Action"
57-
git config --global hub.protocol https
58-
git remote set-url origin https://\${{ secrets.GITHUB_TOKEN }}:[email protected]/swagger-api/swagger-parser.git
59-
- name: Checkout v1
60-
uses: actions/checkout@v2
61-
with:
62-
ref: "v1"
63-
fetch-depth: 0
64-
- name: Run next snapshot script
65-
id: postRelease
66-
if: env.RELEASE_OK == 'yes'
67-
run: |
68-
. ./CI/post-nextsnap-v1.sh
69-
- name: Create Next Snapshot Pull Request
70-
uses: peter-evans/create-pull-request@v2
71-
if: env.RELEASE_OK == 'yes'
72-
with:
73-
token: ${{ steps.generate-token.outputs.token }}
74-
commit-message: bump snapshot ${{ env.SC_NEXT_VERSION }}-SNAPSHOT
75-
title: 'bump snapshot ${{ env.SC_NEXT_VERSION }}-SNAPSHOT'
76-
branch: bump-snap-${{ env.SC_NEXT_VERSION }}-SNAPSHOT
13+
- uses: actions/checkout@v2
14+
- uses: tibdex/github-app-token@v1
15+
id: generate-token
16+
with:
17+
app_id: ${{ secrets.APP_ID }}
18+
private_key: ${{ secrets.APP_PRIVATE_KEY }}
19+
- name: Set up Python 2.7
20+
uses: actions/setup-python@v2
21+
with:
22+
python-version: 2.7
23+
- name: Set up Java 8
24+
uses: actions/setup-java@v1
25+
with:
26+
java-version: 8
27+
server-id: ossrh
28+
server-username: MAVEN_USERNAME
29+
server-password: MAVEN_PASSWORD
30+
- name: Cache local Maven repository
31+
uses: actions/cache@v2
32+
with:
33+
path: ~/.m2/repository
34+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
35+
restore-keys: |
36+
${{ runner.os }}-maven-
37+
- name: Run pre release script
38+
id: preRelease
39+
run: |
40+
# export GPG_TTY=$(tty)
41+
export MY_POM_VERSION=`mvn -q -Dexec.executable="echo" -Dexec.args='${projects.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec`
42+
if [[ $MY_POM_VERSION =~ ^.*SNAPSHOT$ ]];
43+
then
44+
echo "not releasing snapshot version: " ${MY_POM_VERSION}
45+
echo "RELEASE_OK=no" >> $GITHUB_ENV
46+
else
47+
. ./CI/pre-release-v1.sh
48+
echo "RELEASE_OK=yes" >> $GITHUB_ENV
49+
fi
50+
echo "SC_VERSION=$SC_VERSION" >> $GITHUB_ENV
51+
echo "SC_NEXT_VERSION=$SC_NEXT_VERSION" >> $GITHUB_ENV
52+
echo "SC_LAST_RELEASE=$SC_LAST_RELEASE" >> $GITHUB_ENV
53+
- name: configure git user email
54+
run: |
55+
git config --global user.email "[email protected]"
56+
git config --global user.name "GitHub Action"
57+
git config --global hub.protocol https
58+
git remote set-url origin https://\${{ secrets.GITHUB_TOKEN }}:[email protected]/swagger-api/swagger-parser.git
59+
- name: Checkout v1
60+
uses: actions/checkout@v2
61+
with:
62+
ref: "v1"
63+
fetch-depth: 0
64+
- name: Run next snapshot script
65+
id: postRelease
66+
if: env.RELEASE_OK == 'yes'
67+
run: |
68+
. ./CI/post-nextsnap-v1.sh
69+
- name: Create Next Snapshot Pull Request
70+
uses: peter-evans/create-pull-request@v2
71+
if: env.RELEASE_OK == 'yes'
72+
with:
73+
token: ${{ steps.generate-token.outputs.token }}
74+
commit-message: bump snapshot ${{ env.SC_NEXT_VERSION }}-SNAPSHOT
75+
title: 'bump snapshot ${{ env.SC_NEXT_VERSION }}-SNAPSHOT'
76+
branch: bump-snap-${{ env.SC_NEXT_VERSION }}-SNAPSHOT
7777

7878
env:
7979
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}

.github/workflows/next-snapshot.yml

Lines changed: 64 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -10,70 +10,70 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- uses: actions/checkout@v2
14-
- uses: tibdex/github-app-token@v1
15-
id: generate-token
16-
with:
17-
app_id: ${{ secrets.APP_ID }}
18-
private_key: ${{ secrets.APP_PRIVATE_KEY }}
19-
- name: Set up Python 2.7
20-
uses: actions/setup-python@v2
21-
with:
22-
python-version: 2.7
23-
- name: Set up Java 8
24-
uses: actions/setup-java@v1
25-
with:
26-
java-version: 8
27-
server-id: ossrh
28-
server-username: MAVEN_USERNAME
29-
server-password: MAVEN_PASSWORD
30-
- name: Cache local Maven repository
31-
uses: actions/cache@v2
32-
with:
33-
path: ~/.m2/repository
34-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
35-
restore-keys: |
36-
${{ runner.os }}-maven-
37-
- name: Run pre release script
38-
id: preRelease
39-
run: |
40-
# export GPG_TTY=$(tty)
41-
export MY_POM_VERSION=`mvn -q -Dexec.executable="echo" -Dexec.args='${projects.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec`
42-
if [[ $MY_POM_VERSION =~ ^.*SNAPSHOT$ ]];
43-
then
44-
echo "not releasing snapshot version: " ${MY_POM_VERSION}
45-
echo "::set-env name=RELEASE_OK::no"
46-
else
47-
. ./CI/pre-release.sh
48-
echo "::set-env name=RELEASE_OK::yes"
49-
fi
50-
echo "::set-env name=SC_VERSION::$SC_VERSION"
51-
echo "::set-env name=SC_NEXT_VERSION::$SC_NEXT_VERSION"
52-
echo "::set-env name=SC_LAST_RELEASE::$SC_LAST_RELEASE"
53-
- name: configure git user email
54-
run: |
55-
git config --global user.email "[email protected]"
56-
git config --global user.name "GitHub Action"
57-
git config --global hub.protocol https
58-
git remote set-url origin https://\${{ secrets.GITHUB_TOKEN }}:[email protected]/swagger-api/swagger-parser.git
59-
- name: Checkout master
60-
uses: actions/checkout@v2
61-
with:
62-
ref: "master"
63-
fetch-depth: 0
64-
- name: Run next snapshot script
65-
id: postRelease
66-
if: env.RELEASE_OK == 'yes'
67-
run: |
68-
. ./CI/post-nextsnap.sh
69-
- name: Create Next Snapshot Pull Request
70-
uses: peter-evans/create-pull-request@v2
71-
if: env.RELEASE_OK == 'yes'
72-
with:
73-
token: ${{ steps.generate-token.outputs.token }}
74-
commit-message: bump snapshot ${{ env.SC_NEXT_VERSION }}-SNAPSHOT
75-
title: 'bump snapshot ${{ env.SC_NEXT_VERSION }}-SNAPSHOT'
76-
branch: bump-snap-${{ env.SC_NEXT_VERSION }}-SNAPSHOT
13+
- uses: actions/checkout@v2
14+
- uses: tibdex/github-app-token@v1
15+
id: generate-token
16+
with:
17+
app_id: ${{ secrets.APP_ID }}
18+
private_key: ${{ secrets.APP_PRIVATE_KEY }}
19+
- name: Set up Python 2.7
20+
uses: actions/setup-python@v2
21+
with:
22+
python-version: 2.7
23+
- name: Set up Java 8
24+
uses: actions/setup-java@v1
25+
with:
26+
java-version: 8
27+
server-id: ossrh
28+
server-username: MAVEN_USERNAME
29+
server-password: MAVEN_PASSWORD
30+
- name: Cache local Maven repository
31+
uses: actions/cache@v2
32+
with:
33+
path: ~/.m2/repository
34+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
35+
restore-keys: |
36+
${{ runner.os }}-maven-
37+
- name: Run pre release script
38+
id: preRelease
39+
run: |
40+
# export GPG_TTY=$(tty)
41+
export MY_POM_VERSION=`mvn -q -Dexec.executable="echo" -Dexec.args='${projects.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec`
42+
if [[ $MY_POM_VERSION =~ ^.*SNAPSHOT$ ]];
43+
then
44+
echo "not releasing snapshot version: " ${MY_POM_VERSION}
45+
echo "RELEASE_OK=no" >> $GITHUB_ENV
46+
else
47+
. ./CI/pre-release.sh
48+
echo "RELEASE_OK=yes" >> $GITHUB_ENV
49+
fi
50+
echo "SC_VERSION=$SC_VERSION" >> $GITHUB_ENV
51+
echo "SC_NEXT_VERSION=$SC_NEXT_VERSION" >> $GITHUB_ENV
52+
echo "SC_LAST_RELEASE=$SC_LAST_RELEASE" >> $GITHUB_ENV
53+
- name: configure git user email
54+
run: |
55+
git config --global user.email "[email protected]"
56+
git config --global user.name "GitHub Action"
57+
git config --global hub.protocol https
58+
git remote set-url origin https://\${{ secrets.GITHUB_TOKEN }}:[email protected]/swagger-api/swagger-parser.git
59+
- name: Checkout master
60+
uses: actions/checkout@v2
61+
with:
62+
ref: "master"
63+
fetch-depth: 0
64+
- name: Run next snapshot script
65+
id: postRelease
66+
if: env.RELEASE_OK == 'yes'
67+
run: |
68+
. ./CI/post-nextsnap.sh
69+
- name: Create Next Snapshot Pull Request
70+
uses: peter-evans/create-pull-request@v2
71+
if: env.RELEASE_OK == 'yes'
72+
with:
73+
token: ${{ steps.generate-token.outputs.token }}
74+
commit-message: bump snapshot ${{ env.SC_NEXT_VERSION }}-SNAPSHOT
75+
title: 'bump snapshot ${{ env.SC_NEXT_VERSION }}-SNAPSHOT'
76+
branch: bump-snap-${{ env.SC_NEXT_VERSION }}-SNAPSHOT
7777

7878
env:
7979
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}

.github/workflows/prepare-release-v1.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ jobs:
4141
if [[ $MY_POM_VERSION =~ ^.*SNAPSHOT$ ]];
4242
then
4343
. ./CI/prepare-release-v1.sh
44-
echo "::set-env name=PREPARE_RELEASE_OK::yes"
44+
echo "PREPARE_RELEASE_OK=yes" >> $GITHUB_ENV
4545
else
4646
echo "not preparing release for release version: " ${MY_POM_VERSION}
47-
echo "::set-env name=PREPARE_RELEASE_OK::no"
47+
echo "PREPARE_RELEASE_OK=no" >> $GITHUB_ENV
4848
fi
49-
echo "::set-env name=SC_VERSION::$SC_VERSION"
50-
echo "::set-env name=SC_NEXT_VERSION::$SC_NEXT_VERSION"
49+
echo "SC_VERSION=$SC_VERSION" >> $GITHUB_ENV
50+
echo "SC_NEXT_VERSION=$SC_NEXT_VERSION" >> $GITHUB_ENV
5151
- name: Create Prepare Release Pull Request
5252
uses: peter-evans/create-pull-request@v2
5353
if: env.PREPARE_RELEASE_OK == 'yes'

.github/workflows/prepare-release.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ jobs:
4141
if [[ $MY_POM_VERSION =~ ^.*SNAPSHOT$ ]];
4242
then
4343
. ./CI/prepare-release.sh
44-
echo "::set-env name=PREPARE_RELEASE_OK::yes"
44+
echo "PREPARE_RELEASE_OK=yes" >> $GITHUB_ENV
4545
else
4646
echo "not preparing release for release version: " ${MY_POM_VERSION}
47-
echo "::set-env name=PREPARE_RELEASE_OK::no"
47+
echo "PREPARE_RELEASE_OK=no" >> $GITHUB_ENV
4848
fi
49-
echo "::set-env name=SC_VERSION::$SC_VERSION"
50-
echo "::set-env name=SC_NEXT_VERSION::$SC_NEXT_VERSION"
49+
echo "SC_VERSION=$SC_VERSION" >> $GITHUB_ENV
50+
echo "SC_NEXT_VERSION=$SC_NEXT_VERSION" >> $GITHUB_ENV
5151
- name: Create Prepare Release Pull Request
5252
uses: peter-evans/create-pull-request@v2
5353
if: env.PREPARE_RELEASE_OK == 'yes'

.github/workflows/release-v1.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ jobs:
4242
if [[ $MY_POM_VERSION =~ ^.*SNAPSHOT$ ]];
4343
then
4444
echo "not releasing snapshot version: " ${MY_POM_VERSION}
45-
echo "::set-env name=RELEASE_OK::no"
45+
echo "RELEASE_OK=no" >> $GITHUB_ENV
4646
else
4747
. ./CI/pre-release-v1.sh
48-
echo "::set-env name=RELEASE_OK::yes"
48+
echo "RELEASE_OK=yes" >> $GITHUB_ENV
4949
fi
50-
echo "::set-env name=SC_VERSION::$SC_VERSION"
51-
echo "::set-env name=SC_NEXT_VERSION::$SC_NEXT_VERSION"
52-
echo "::set-env name=SC_LAST_RELEASE::$SC_LAST_RELEASE"
50+
echo "SC_VERSION=$SC_VERSION" >> $GITHUB_ENV
51+
echo "SC_NEXT_VERSION=$SC_NEXT_VERSION" >> $GITHUB_ENV
52+
echo "SC_LAST_RELEASE=$SC_LAST_RELEASE" >> $GITHUB_ENV
5353
- name: configure git user email
5454
run: |
5555
git config --global user.email "[email protected]"

.github/workflows/release.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ jobs:
4242
if [[ $MY_POM_VERSION =~ ^.*SNAPSHOT$ ]];
4343
then
4444
echo "not releasing snapshot version: " ${MY_POM_VERSION}
45-
echo "::set-env name=RELEASE_OK::no"
45+
echo "RELEASE_OK=no" >> $GITHUB_ENV
4646
else
4747
. ./CI/pre-release.sh
48-
echo "::set-env name=RELEASE_OK::yes"
48+
echo "RELEASE_OK=yes" >> $GITHUB_ENV
4949
fi
50-
echo "::set-env name=SC_VERSION::$SC_VERSION"
51-
echo "::set-env name=SC_NEXT_VERSION::$SC_NEXT_VERSION"
52-
echo "::set-env name=SC_LAST_RELEASE::$SC_LAST_RELEASE"
50+
echo "SC_VERSION=$SC_VERSION" >> $GITHUB_ENV
51+
echo "SC_NEXT_VERSION=$SC_NEXT_VERSION" >> $GITHUB_ENV
52+
echo "SC_LAST_RELEASE=$SC_LAST_RELEASE" >> $GITHUB_ENV
5353
- name: configure git user email
5454
run: |
5555
git config --global user.email "[email protected]"

0 commit comments

Comments
 (0)