Skip to content

Commit

Permalink
[chore] Update Github action workflows to fix node version and `set-o…
Browse files Browse the repository at this point in the history
…utput` deprecation warnings (#376)
  • Loading branch information
jonathanedey authored Apr 9, 2024
1 parent 50b0ed9 commit 12c688a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 19 deletions.
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 @@ -155,12 +155,13 @@ readonly CHANGELOG=`${CURRENT_DIR}/generate_changelog.sh`
echo "$CHANGELOG"

# Parse and preformat the text to handle multi-line output.
# See https://github.community/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
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4


- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,17 @@ jobs:
runs-on: ubuntu-latest

env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_NOLOGO: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
DOTNET_NOLOGO: true

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


- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
Expand Down
16 changes: 6 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
with:
ref: ${{ github.event.client_payload.ref || github.ref }}


- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
Expand Down Expand Up @@ -108,6 +109,7 @@ jobs:
with:
name: Release


- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
Expand All @@ -117,19 +119,13 @@ jobs:
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 .NET 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 .NET SDK ${{ steps.preflight.outputs.version }}"
--notes '${{ steps.preflight.outputs.changelog }}'

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

0 comments on commit 12c688a

Please sign in to comment.