Skip to content

Commit 1b8a162

Browse files
authored
[chore] Update Github action workflows to fix node version and set-output deprecation warnings (firebase#601)
* [chore] Update Github action workflows to fix node version and `set-output` deprecation warnings * Trigger staging tests * Trigger staging tests * fix: Swap `checkout` and `setup-go` order to correctly load cache from `go.sum`
1 parent 22deeba commit 1b8a162

File tree

4 files changed

+30
-36
lines changed

4 files changed

+30
-36
lines changed

‎.github/scripts/publish_preflight_check.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ if [[ ! "${RELEASE_VERSION}" =~ ^([0-9]*)\.([0-9]*)\.([0-9]*)$ ]]; then
6464
fi
6565

6666
echo_info "Extracted release version: ${RELEASE_VERSION}"
67-
echo "::set-output name=version::v${RELEASE_VERSION}"
67+
echo "version=v${RELEASE_VERSION}" >> $GITHUB_OUTPUT
6868

6969

7070
echo_info ""
@@ -108,13 +108,13 @@ readonly CHANGELOG=`${CURRENT_DIR}/generate_changelog.sh`
108108
echo "$CHANGELOG"
109109

110110
# Parse and preformat the text to handle multi-line output.
111-
# See https://github.community/t5/GitHub-Actions/set-output-Truncates-Multiline-Strings/td-p/37870
111+
# See https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#example-of-a-multiline-string
112+
# and https://github.com/github/docs/issues/21529#issue-1418590935
112113
FILTERED_CHANGELOG=`echo "$CHANGELOG" | grep -v "\\[INFO\\]"`
113-
FILTERED_CHANGELOG="${FILTERED_CHANGELOG//'%'/'%25'}"
114-
FILTERED_CHANGELOG="${FILTERED_CHANGELOG//$'\n'/'%0A'}"
115-
FILTERED_CHANGELOG="${FILTERED_CHANGELOG//$'\r'/'%0D'}"
116-
echo "::set-output name=changelog::${FILTERED_CHANGELOG}"
117-
114+
FILTERED_CHANGELOG="${FILTERED_CHANGELOG//$'\''/'"'}"
115+
echo "changelog<<CHANGELOGEOF" >> $GITHUB_OUTPUT
116+
echo -e "$FILTERED_CHANGELOG" >> $GITHUB_OUTPUT
117+
echo "CHANGELOGEOF" >> $GITHUB_OUTPUT
118118

119119
echo ""
120120
echo_info "--------------------------------------------"

‎.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ jobs:
1111
go: [1.17, 1.18, 1.19]
1212

1313
steps:
14+
- name: Check out code
15+
uses: actions/checkout@v4
16+
1417
- name: Set up Go ${{ matrix.go }}
15-
uses: actions/setup-go@v3
18+
uses: actions/setup-go@v5
1619
with:
1720
go-version: ${{ matrix.go }}
1821

1922
- name: Install golint
2023
run: go install golang.org/x/lint/golint@latest
2124

22-
- name: Check out code
23-
uses: actions/checkout@v2
24-
2525
- name: Run Linter
2626
run: |
2727
golint -set_exit_status ./...

‎.github/workflows/nightly.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,19 @@ jobs:
2828
runs-on: ubuntu-latest
2929

3030
steps:
31+
- name: Check out code
32+
uses: actions/checkout@v4
33+
with:
34+
ref: ${{ github.event.client_payload.ref || github.ref }}
35+
3136
- name: Set up Go
32-
uses: actions/setup-go@v3
37+
uses: actions/setup-go@v5
3338
with:
3439
go-version: 1.17
3540

3641
- name: Install golint
3742
run: go install golang.org/x/lint/golint@latest
3843

39-
- name: Check out code
40-
uses: actions/checkout@v2
41-
with:
42-
ref: ${{ github.event.client_payload.ref || github.ref }}
43-
4444
- name: Run Linter
4545
run: |
4646
golint -set_exit_status ./...

‎.github/workflows/release.yml

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,19 @@ jobs:
3939
# When manually triggering the build, the requester can specify a target branch or a tag
4040
# via the 'ref' client parameter.
4141
steps:
42+
- name: Check out code
43+
uses: actions/checkout@v4
44+
with:
45+
ref: ${{ github.event.client_payload.ref || github.ref }}
46+
4247
- name: Set up Go
43-
uses: actions/setup-go@v3
48+
uses: actions/setup-go@v5
4449
with:
4550
go-version: 1.17
4651

4752
- name: Install golint
4853
run: go install golang.org/x/lint/golint@latest
4954

50-
- name: Check out code
51-
uses: actions/checkout@v2
52-
with:
53-
ref: ${{ github.event.client_payload.ref || github.ref }}
54-
5555
- name: Run Linter
5656
run: |
5757
golint -set_exit_status ./...
@@ -79,7 +79,7 @@ jobs:
7979

8080
steps:
8181
- name: Checkout source for publish
82-
uses: actions/checkout@v2
82+
uses: actions/checkout@v4
8383
with:
8484
persist-credentials: false
8585

@@ -89,7 +89,7 @@ jobs:
8989

9090
# We authorize this step with an access token that has write access to the master branch.
9191
- name: Merge to master
92-
uses: actions/github-script@0.9.0
92+
uses: actions/github-script@v7
9393
with:
9494
github-token: ${{ secrets.FIREBASE_GITHUB_TOKEN }}
9595
script: |
@@ -100,20 +100,14 @@ jobs:
100100
head: 'dev'
101101
})
102102
103-
# We pull this action from a custom fork of a contributor until
104-
# https://github.com/actions/create-release/pull/32 is merged. Also note that v1 of
105-
# this action does not support the "body" parameter.
103+
# See: https://cli.github.com/manual/gh_release_create
106104
- name: Create release tag
107-
uses: fleskesvor/create-release@1a72e235c178bf2ae6c51a8ae36febc24568c5fe
108105
env:
109106
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
110-
with:
111-
tag_name: ${{ steps.preflight.outputs.version }}
112-
release_name: Firebase Admin Go SDK ${{ steps.preflight.outputs.version }}
113-
body: ${{ steps.preflight.outputs.changelog }}
114-
commitish: master
115-
draft: false
116-
prerelease: false
107+
run: gh release create ${{ steps.preflight.outputs.version }}
108+
--title "Firebase Admin Go SDK ${{ steps.preflight.outputs.version }}"
109+
--notes '${{ steps.preflight.outputs.changelog }}'
110+
--target "master"
117111

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

0 commit comments

Comments
 (0)