Skip to content

Commit 67e8435

Browse files
authored
[chore] Update Github action workflows to fix node version and set-output deprecation warnings (#905)
* Update Github action workflows to fix node version and `set-output` deprecation warnings * revert upload-artifact to v1 * revert upload-artifact to v1 * fix: JDK version syntax
1 parent cbf68e5 commit 67e8435

File tree

4 files changed

+29
-30
lines changed

4 files changed

+29
-30
lines changed

.github/scripts/publish_preflight_check.sh

+7-6
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ if [[ ! "${RELEASE_VERSION}" =~ ^([0-9]*)\.([0-9]*)\.([0-9]*)$ ]]; then
6969
fi
7070

7171
echo_info "Extracted release version: ${RELEASE_VERSION}"
72-
echo "::set-output name=version::v${RELEASE_VERSION}"
72+
echo "version=v${RELEASE_VERSION}" >> $GITHUB_OUTPUT
7373

7474

7575
echo_info ""
@@ -132,12 +132,13 @@ readonly CHANGELOG=`${CURRENT_DIR}/generate_changelog.sh`
132132
echo "$CHANGELOG"
133133

134134
# Parse and preformat the text to handle multi-line output.
135-
# See https://github.community/t5/GitHub-Actions/set-output-Truncates-Multiline-Strings/td-p/37870
135+
# See https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#example-of-a-multiline-string
136+
# and https://github.com/github/docs/issues/21529#issue-1418590935
136137
FILTERED_CHANGELOG=`echo "$CHANGELOG" | grep -v "\\[INFO\\]"`
137-
FILTERED_CHANGELOG="${FILTERED_CHANGELOG//'%'/'%25'}"
138-
FILTERED_CHANGELOG="${FILTERED_CHANGELOG//$'\n'/'%0A'}"
139-
FILTERED_CHANGELOG="${FILTERED_CHANGELOG//$'\r'/'%0D'}"
140-
echo "::set-output name=changelog::${FILTERED_CHANGELOG}"
138+
FILTERED_CHANGELOG="${FILTERED_CHANGELOG//$'\''/'"'}"
139+
echo "changelog<<CHANGELOGEOF" >> $GITHUB_OUTPUT
140+
echo -e "$FILTERED_CHANGELOG" >> $GITHUB_OUTPUT
141+
echo "CHANGELOGEOF" >> $GITHUB_OUTPUT
141142

142143

143144
echo ""

.github/workflows/ci.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@ jobs:
2424
java-version: [8, 11, 17]
2525

2626
steps:
27-
- uses: actions/checkout@v1
27+
- uses: actions/checkout@v4
2828

2929
- name: Set up JDK
30-
uses: actions/setup-java@v1
30+
uses: actions/setup-java@v4
3131
with:
32+
distribution: 'zulu'
3233
java-version: ${{ matrix.java-version }}
3334

3435
# Does the following:

.github/workflows/nightly.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,15 @@ jobs:
2929

3030
steps:
3131
- name: Checkout source for staging
32-
uses: actions/checkout@v2
32+
uses: actions/checkout@v4
3333
with:
3434
ref: ${{ github.event.client_payload.ref || github.ref }}
3535

36-
- name: Set up JDK 1.8
37-
uses: actions/setup-java@v1
36+
- name: Set up JDK 8
37+
uses: actions/setup-java@v4
3838
with:
39-
java-version: 1.8
39+
distribution: 'zulu'
40+
java-version: 8
4041

4142
- name: Compile, test and package
4243
run: ./.github/scripts/package_artifacts.sh

.github/workflows/release.yml

+14-18
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,15 @@ jobs:
4040
# via the 'ref' client parameter.
4141
steps:
4242
- name: Checkout source for staging
43-
uses: actions/checkout@v2
43+
uses: actions/checkout@v4
4444
with:
4545
ref: ${{ github.event.client_payload.ref || github.ref }}
4646

47-
- name: Set up JDK 1.8
48-
uses: actions/setup-java@v1
47+
- name: Set up JDK 8
48+
uses: actions/setup-java@v4
4949
with:
50-
java-version: 1.8
50+
distribution: 'zulu'
51+
java-version: 8
5152

5253
- name: Compile, test and package
5354
run: ./.github/scripts/package_artifacts.sh
@@ -80,12 +81,13 @@ jobs:
8081

8182
steps:
8283
- name: Checkout source for publish
83-
uses: actions/checkout@v2
84+
uses: actions/checkout@v4
8485

85-
- name: Set up JDK 1.8
86-
uses: actions/setup-java@v1
86+
- name: Set up JDK 8
87+
uses: actions/setup-java@v4
8788
with:
88-
java-version: 1.8
89+
distribution: 'zulu'
90+
java-version: 8
8991

9092
- name: Publish preflight check
9193
id: preflight
@@ -99,19 +101,13 @@ jobs:
99101
NEXUS_OSSRH_USERNAME: ${{ secrets.NEXUS_OSSRH_USERNAME }}
100102
NEXUS_OSSRH_PASSWORD: ${{ secrets.NEXUS_OSSRH_PASSWORD }}
101103

102-
# We pull this action from a custom fork of a contributor until
103-
# https://github.com/actions/create-release/pull/32 is merged. Also note that v1 of
104-
# this action does not support the "body" parameter.
104+
# See: https://cli.github.com/manual/gh_release_create
105105
- name: Create release tag
106-
uses: fleskesvor/create-release@1a72e235c178bf2ae6c51a8ae36febc24568c5fe
107106
env:
108107
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
109-
with:
110-
tag_name: ${{ steps.preflight.outputs.version }}
111-
release_name: Firebase Admin Java SDK ${{ steps.preflight.outputs.version }}
112-
body: ${{ steps.preflight.outputs.changelog }}
113-
draft: false
114-
prerelease: false
108+
run: gh release create ${{ steps.preflight.outputs.version }}
109+
--title "Firebase Admin Java SDK ${{ steps.preflight.outputs.version }}"
110+
--notes '${{ steps.preflight.outputs.changelog }}'
115111

116112
# Post to Twitter if explicitly opted-in by adding the label 'release:tweet'.
117113
- name: Post to Twitter

0 commit comments

Comments
 (0)