forked from actions/setup-java
-
Notifications
You must be signed in to change notification settings - Fork 0
V2 preview #8
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
Open
Mattquach93
wants to merge
7
commits into
main
Choose a base branch
from
v2-preview
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
V2 preview #8
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
7c88894
actions/setup-java@v2 - Support different distributions (#132)
maxim-lobanov 804a60f
Add "overwrite-settings" input parameter (#136)
maxim-lobanov 502a665
Add "Contents/Home" postfix on macOS if provider creates it (#139)
maxim-lobanov 022e86d
Add check-latest flag (#141)
dmitry-shibanov 46d5f06
Avoid "+" sign in Java path in v2-preview (#145)
maxim-lobanov 40763c4
Merge branch 'main' into v2-preview
68e87bb
update npm licenses
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| name: Build Action | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| - releases/* | ||
| - v2-preview | ||
| paths-ignore: | ||
| - '**.md' | ||
| pull_request: | ||
| paths-ignore: | ||
| - '**.md' | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [ubuntu-latest, windows-latest, macos-latest] | ||
| steps: | ||
| - uses: actions/checkout@v2 | ||
| - name: Setup Node.JS 12 | ||
| uses: actions/setup-node@v2 | ||
| with: | ||
| node-version: 12.x | ||
| - run: npm ci | ||
| - run: npm run build | ||
| - run: npm run format-check | ||
| - run: npm test | ||
| - name: Verify no unstaged changes | ||
| if: runner.os != 'windows' | ||
| run: bash __tests__/verify-no-unstaged-changes.sh | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| name: Validate local file | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| - releases/* | ||
| - v2-preview | ||
| paths-ignore: | ||
| - '**.md' | ||
| pull_request: | ||
| paths-ignore: | ||
| - '**.md' | ||
|
|
||
| jobs: | ||
| setup-java-local-file-adopt: | ||
| name: Validate installation from local file Adopt | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [macos-latest, windows-latest, ubuntu-latest] | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v2 | ||
| - name: Download Adopt OpenJDK file | ||
| run: | | ||
| if ($IsLinux) { | ||
| $downloadUrl = "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.10%2B9/OpenJDK11U-jdk_x64_linux_hotspot_11.0.10_9.tar.gz" | ||
| $localFilename = "java_package.tar.gz" | ||
| } elseif ($IsMacOS) { | ||
| $downloadUrl = "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.10%2B9/OpenJDK11U-jdk_x64_mac_hotspot_11.0.10_9.tar.gz" | ||
| $localFilename = "java_package.tar.gz" | ||
| } elseif ($IsWindows) { | ||
| $downloadUrl = "https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.10%2B9/OpenJDK11U-jdk_x64_windows_hotspot_11.0.10_9.zip" | ||
| $localFilename = "java_package.zip" | ||
| } | ||
| echo "LocalFilename=$localFilename" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||
| (New-Object System.Net.WebClient).DownloadFile($downloadUrl, "$env:RUNNER_TEMP/$localFilename") | ||
| shell: pwsh | ||
| - name: setup-java | ||
| uses: ./ | ||
| id: setup-java | ||
| with: | ||
| distribution: 'jdkfile' | ||
| jdkFile: ${{ runner.temp }}/${{ env.LocalFilename }} | ||
| java-version: '11.0.0-ea' | ||
| architecture: x64 | ||
| - name: Verify Java version | ||
| run: bash __tests__/verify-java.sh "11.0.10" "${{ steps.setup-java.outputs.path }}" | ||
| shell: bash | ||
|
|
||
| setup-java-local-file-zulu: | ||
| name: Validate installation from local file Zulu | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [macos-latest, windows-latest, ubuntu-latest] | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v2 | ||
| - name: Download Zulu OpenJDK file | ||
| run: | | ||
| if ($IsLinux) { | ||
| $downloadUrl = "https://cdn.azul.com/zulu/bin/zulu11.2.3-jdk11.0.1-linux_x64.tar.gz" | ||
| $localFilename = "java_package.tar.gz" | ||
| } elseif ($IsMacOS) { | ||
| $downloadUrl = "https://cdn.azul.com/zulu/bin/zulu11.2.3-jdk11.0.1-macosx_x64.tar.gz" | ||
| $localFilename = "java_package.tar.gz" | ||
| } elseif ($IsWindows) { | ||
| $downloadUrl = "https://cdn.azul.com/zulu/bin/zulu11.45.27-ca-jdk11.0.10-win_x64.zip" | ||
| $localFilename = "java_package.zip" | ||
| } | ||
| echo "LocalFilename=$localFilename" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||
| (New-Object System.Net.WebClient).DownloadFile($downloadUrl, "$env:RUNNER_TEMP/$localFilename") | ||
| shell: pwsh | ||
| - name: setup-java | ||
| uses: ./ | ||
| id: setup-java | ||
| with: | ||
| distribution: 'jdkfile' | ||
| jdkFile: ${{ runner.temp }}/${{ env.LocalFilename }} | ||
| java-version: '11.0.0-ea' | ||
| architecture: x64 | ||
| - name: Verify Java version | ||
| run: bash __tests__/verify-java.sh "11.0" "${{ steps.setup-java.outputs.path }}" | ||
| shell: bash |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,153 @@ | ||
| name: Validate publishing functionality | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| - releases/* | ||
| - v2-preview | ||
| paths-ignore: | ||
| - '**.md' | ||
| pull_request: | ||
| paths-ignore: | ||
| - '**.md' | ||
|
|
||
| defaults: | ||
| run: | ||
| shell: pwsh | ||
|
|
||
| jobs: | ||
| setup-java-publishing: | ||
| name: Validate settings.xml | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [macos-latest, windows-latest, ubuntu-latest] | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v2 | ||
| - name: setup-java | ||
| uses: ./ | ||
| id: setup-java | ||
| with: | ||
| distribution: 'adopt' | ||
| java-version: '11' | ||
| server-id: maven | ||
| server-username: MAVEN_USERNAME | ||
| server-password: MAVEN_CENTRAL_TOKEN | ||
| gpg-passphrase: MAVEN_GPG_PASSPHRASE | ||
| - name: Validate settings.xml | ||
| run: | | ||
| $xmlPath = Join-Path $HOME ".m2" "settings.xml" | ||
| Get-Content $xmlPath | ForEach-Object { Write-Host $_ } | ||
|
|
||
| [xml]$xml = Get-Content $xmlPath | ||
| $servers = $xml.settings.servers.server | ||
| if (($servers[0].id -ne 'maven') -or ($servers[0].username -ne '${env.MAVEN_USERNAME}') -or ($servers[0].password -ne '${env.MAVEN_CENTRAL_TOKEN}')) { | ||
| throw "Generated XML file is incorrect" | ||
| } | ||
|
|
||
| if (($servers[1].id -ne 'gpg.passphrase') -or ($servers[1].passphrase -ne '${env.MAVEN_GPG_PASSPHRASE}')) { | ||
| throw "Generated XML file is incorrect" | ||
| } | ||
|
|
||
| test-publishing-overwrite: | ||
| name: settings.xml is overwritten if flag is true | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [macos-latest, windows-latest, ubuntu-latest] | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v2 | ||
| - name: Create fake settings.xml | ||
| run: | | ||
| $xmlDirectory = Join-Path $HOME ".m2" | ||
| $xmlPath = Join-Path $xmlDirectory "settings.xml" | ||
| New-Item -Path $xmlDirectory -ItemType Directory | ||
| Set-Content -Path $xmlPath -Value "Fake_XML" | ||
| - name: setup-java | ||
| uses: ./ | ||
| id: setup-java | ||
| with: | ||
| distribution: 'adopt' | ||
| java-version: '11' | ||
| server-id: maven | ||
| server-username: MAVEN_USERNAME | ||
| server-password: MAVEN_CENTRAL_TOKEN | ||
| gpg-passphrase: MAVEN_GPG_PASSPHRASE | ||
| - name: Validate settings.xml is overwritten | ||
| run: | | ||
| $xmlPath = Join-Path $HOME ".m2" "settings.xml" | ||
| Get-Content $xmlPath | ForEach-Object { Write-Host $_ } | ||
|
|
||
| $content = Get-Content $xmlPath -Raw | ||
| if ($content -notlike '*maven*') { | ||
| throw "settings.xml file is not overwritten" | ||
| } | ||
|
|
||
| test-publishing-skip-overwrite: | ||
| name: settings.xml is not overwritten if flag is false | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [macos-latest, windows-latest, ubuntu-latest] | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v2 | ||
| - name: Create fake settings.xml | ||
| run: | | ||
| $xmlDirectory = Join-Path $HOME ".m2" | ||
| $xmlPath = Join-Path $xmlDirectory "settings.xml" | ||
| New-Item -Path $xmlDirectory -ItemType Directory | ||
| Set-Content -Path $xmlPath -Value "Fake_XML" | ||
| - name: setup-java | ||
| uses: ./ | ||
| id: setup-java | ||
| with: | ||
| distribution: 'adopt' | ||
| java-version: '11' | ||
| server-id: maven | ||
| server-username: MAVEN_USERNAME | ||
| server-password: MAVEN_CENTRAL_TOKEN | ||
| overwrite-settings: false | ||
| gpg-passphrase: MAVEN_GPG_PASSPHRASE | ||
| - name: Validate that settings.xml is not overwritten | ||
| run: | | ||
| $xmlPath = Join-Path $HOME ".m2" "settings.xml" | ||
| $content = Get-Content -Path $xmlPath -Raw | ||
| Write-Host $content | ||
|
|
||
| if ($content -notlike "*Fake_XML*") { | ||
| throw "settings.xml file was overwritten but it should not be" | ||
| } | ||
|
|
||
| test-publishing-custom-location: | ||
| name: settings.xml in custom location | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [macos-latest, windows-latest, ubuntu-latest] | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v2 | ||
| - name: setup-java | ||
| uses: ./ | ||
| id: setup-java | ||
| with: | ||
| distribution: 'adopt' | ||
| java-version: '11' | ||
| server-id: maven | ||
| server-username: MAVEN_USERNAME | ||
| server-password: MAVEN_CENTRAL_TOKEN | ||
| gpg-passphrase: MAVEN_GPG_PASSPHRASE | ||
| settings-path: ${{ runner.temp }} | ||
| - name: Validate settings.xml location | ||
| run: | | ||
| $path = Join-Path $env:RUNNER_TEMP "settings.xml" | ||
| if (-not (Test-Path $path)) { | ||
| throw "settings.xml file is not found in expected location" | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actiosn confirmed for single storage have successfully integrated development with app processing on my IDE with significant running actions.