Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[chore] Update Github action workflows to fix node version and set-output deprecation warnings #2431

Merged
merged 3 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions .github/scripts/publish_preflight_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ if [[ ! "${RELEASE_VERSION}" =~ ^([0-9]*)\.([0-9]*)\.([0-9]*)$ ]]; then
fi

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


echo_info ""
Expand Down Expand Up @@ -156,12 +156,13 @@ readonly CHANGELOG=`${CURRENT_DIR}/generate_changelog.sh`
echo "$CHANGELOG"

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


echo ""
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
node-version: [14.x, 16.x]

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install and build
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ jobs:

steps:
- name: Checkout source for staging
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ref: ${{ github.event.client_payload.ref || github.ref }}

- name: Set up Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: 14.x

Expand Down
22 changes: 8 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ jobs:
# via the 'ref' client parameter.
steps:
- name: Checkout source for staging
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ref: ${{ github.event.client_payload.ref || github.ref }}

- name: Set up Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: 14.x

Expand Down Expand Up @@ -104,7 +104,7 @@ jobs:

steps:
- name: Checkout source for publish
uses: actions/checkout@v2
uses: actions/checkout@v4

# Download the artifacts created by the stage_release job.
- name: Download release candidates
Expand All @@ -114,27 +114,21 @@ jobs:

# Node.js and NPM are needed to complete the publish.
- name: Set up Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: 14.x

- name: Publish preflight check
id: preflight
run: ./.github/scripts/publish_preflight_check.sh

# We pull this action from a custom fork of a contributor until
# https://github.com/actions/create-release/pull/32 is merged. Also note that v1 of
# this action does not support the "body" parameter.
# See: https://cli.github.com/manual/gh_release_create
- name: Create release tag
uses: fleskesvor/create-release@1a72e235c178bf2ae6c51a8ae36febc24568c5fe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.preflight.outputs.version }}
release_name: Firebase Admin Node.js SDK ${{ steps.preflight.outputs.version }}
body: ${{ steps.preflight.outputs.changelog }}
draft: false
prerelease: false
run: gh release create ${{ steps.preflight.outputs.version }}
--title "Firebase Admin Node.js SDK ${{ steps.preflight.outputs.version }}"
--notes '${{ steps.preflight.outputs.changelog }}'

- name: Publish to NPM
run: ./.github/scripts/publish_package.sh
Expand Down
Loading