Skip to content

Commit

Permalink
chore(gha): replace deprecated set-output and save-state commands (#186)
Browse files Browse the repository at this point in the history
* chore(gha): replace deprecated set-output commands with environment files

Run echo ::set-output name=REPO::${GITHUB_REPOSITORY##*/}
Warning: The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Warning: The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

See https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

* chore(gha): update setup-java GHA to v2

to stay up to date, and to (try to) address warnings like:

Warning: The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

from https://github.com/spinnaker/spinnaker-gradle-project/actions/runs/3498159465/jobs/5858161543

see spinnaker/spinnaker#6611 and https://github.com/actions/setup-java/blob/main/docs/switching-to-v2.md

* chore(gha): use setup-java@v3 to stay up to date

and to avoid warning messages like

Warning: The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

from https://github.com/spinnaker/spinnaker-gradle-project/actions/runs/3498280057/jobs/5858433585
  • Loading branch information
dbyron-sf committed Nov 18, 2022
1 parent 0c8768e commit 9f87270
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 25 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
- uses: actions/setup-java@v3
with:
java-version: 11
- uses: actions/cache@v1
with:
path: ~/.gradle
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: |
${{ runner.os }}-gradle-
distribution: 'zulu'
cache: 'gradle'
- name: Build
run: ./gradlew build --stacktrace
10 changes: 3 additions & 7 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
- uses: actions/setup-java@v3
with:
java-version: 11
- uses: actions/cache@v1
with:
path: ~/.gradle
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: |
${{ runner.os }}-gradle-
distribution: 'zulu'
cache: 'gradle'
- name: Build
run: ./gradlew build
18 changes: 7 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,21 @@ jobs:
steps:
- uses: actions/checkout@v2
- run: git fetch --prune --unshallow
- uses: actions/setup-java@v1
- uses: actions/setup-java@v3
with:
java-version: 11
- uses: actions/cache@v1
with:
path: ~/.gradle
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: |
${{ runner.os }}-gradle-
distribution: 'zulu'
cache: 'gradle'
- name: Assemble release info
id: release_info
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
. .github/workflows/release_info.sh ${{ github.event.repository.full_name }}
echo ::set-output name=CHANGELOG::$(echo -e "${CHANGELOG}")
echo ::set-output name=SKIP_RELEASE::${SKIP_RELEASE}
echo ::set-output name=IS_CANDIDATE::${IS_CANDIDATE}
echo ::set-output name=RELEASE_VERSION::${RELEASE_VERSION}
echo CHANGELOG=$(echo -e "${CHANGELOG}") >> $GITHUB_OUTPUT
echo SKIP_RELEASE="${SKIP_RELEASE}" >> $GITHUB_OUTPUT
echo IS_CANDIDATE="${IS_CANDIDATE}" >> $GITHUB_OUTPUT
echo RELEASE_VERSION="${RELEASE_VERSION}" >> $GITHUB_OUTPUT
- name: Release build
env:
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
Expand Down

0 comments on commit 9f87270

Please sign in to comment.