Skip to content

Commit

Permalink
Fix chocolatey-test when used in stable releases (#22415)
Browse files Browse the repository at this point in the history
Release scripts were previously failing in `test-chocolatey`. These were
using incorrect layout assuming that we're downloading jar from GH
Actions.

```pwsh
if ($env:DOTTY_CI_INSTALLATION) {
```
would now be evaluated as empty string which for if-condition would be
evaluated as `false`.
  • Loading branch information
WojciechMazur authored Jan 21, 2025
2 parents 8f5b0e0 + 1123846 commit 5adcac1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -911,14 +911,14 @@ jobs:
uses: ./.github/workflows/build-chocolatey.yml
needs: [ build-sdk-package ]
with:
version: 3.6.0-local # TODO: FIX THIS
version: 3.6.0-SNAPSHOT # Fake version, used only for choco tests
url : https://api.github.com/repos/scala/scala3/actions/artifacts/${{ needs.build-sdk-package.outputs.win-x86_64-id }}/zip
digest : ${{ needs.build-sdk-package.outputs.win-x86_64-digest }}

test-chocolatey-package:
uses: ./.github/workflows/test-chocolatey.yml
with:
version : 3.6.0-local # TODO: FIX THIS
version : 3.6.0-SNAPSHOT # Fake version, used only for choco tests
java-version: 8
if: github.event_name == 'pull_request' && contains(github.event.pull_request.body, '[test_chocolatey]')
needs: [ build-chocolatey-package ]
5 changes: 4 additions & 1 deletion .github/workflows/test-chocolatey.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ on:

env:
CHOCOLATEY-REPOSITORY: chocolatey-pkgs
DOTTY_CI_INSTALLATION: ${{ secrets.GITHUB_TOKEN }}
# Controls behaviour of chocolatey{Install,Uninstall}.ps1 scripts
# During snapshot releases it uses a different layout and requires access token to GH Actions artifacts
# During stable releases it uses publically available archives
DOTTY_CI_INSTALLATION: ${{ endsWith(inputs.version, '-SNAPSHOT') && secrets.GITHUB_TOKEN || '' }}

jobs:
test:
Expand Down

0 comments on commit 5adcac1

Please sign in to comment.