Add jdk21.ps1 and jre21.ps1 #834
Workflow file for this run
This file contains 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
name: Build Packages | |
on: | |
push: | |
schedule: | |
- cron: '9 2 */4 * *' | |
workflow_dispatch: | |
jobs: | |
init: | |
runs-on: windows-2022 | |
outputs: | |
matrix: ${{ steps.init.outputs.matrix }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Analyze packages | |
id: init | |
run: | | |
. .\src\main.ps1 | |
Save-WorkflowMatrix | |
$matrix = Get-Content .matrix | |
Write-Output "matrix=$matrix" | Out-File $env:GITHUB_OUTPUT utf8 -Append | |
build: | |
needs: init | |
runs-on: windows-2022 | |
strategy: | |
fail-fast: false | |
matrix: ${{ fromJson(needs.init.outputs.matrix) }} | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Run ${{ matrix.package }} | |
id: pkg | |
run: | | |
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted | |
Install-Module Airpower -Scope CurrentUser | |
. .\src\main.ps1 | |
Invoke-PwrScript '${{ matrix.package }}' | |
Write-Output "up-to-date=$($true -eq $PwrPackageConfig.UpToDate)" | Out-File $env:GITHUB_OUTPUT utf8 -Append | |
Write-Output "name=$($PwrPackageConfig.Name)" | Out-File $env:GITHUB_OUTPUT utf8 -Append | |
Write-Output "version=$($PwrPackageConfig.Version)" | Out-File $env:GITHUB_OUTPUT utf8 -Append | |
- name: Scan package | |
if: ${{ steps.pkg.outputs.up-to-date == 'False' }} | |
run: | | |
. .\src\main.ps1 | |
Invoke-PwrPackageScan | |
- name: Login to DockerHub | |
if: ${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/')) && steps.pkg.outputs.up-to-date == 'False' }} | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build and push container | |
if: ${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/')) && steps.pkg.outputs.up-to-date == 'False' }} | |
run: | | |
. .\src\main.ps1 | |
& '${{ matrix.package }}' | |
Invoke-DockerPush ${{ steps.pkg.outputs.name }} ${{ steps.pkg.outputs.version }} |