Compare commits

..

23 Commits

Author SHA1 Message Date
aparnajyothi-y
a11efb4aa3 Update build-tool-packages.yml 2025-01-08 19:06:44 +05:30
Priya Gupta
4028baf988 Replace deprecated release action with GitHub CLI (#80) 2024-11-12 21:15:45 -06:00
aparnajyothi-y
d30950623a Upgrade the checkout to V4 (#79)
* Update versions to latest

* Update create-pr-to-update-manifest.yml

* Update get-new-tool-versions.yml

* Update get-tools-new-versions.yml

* Update validate-manifest.yml
2024-11-12 21:11:54 -06:00
gowridurgad
16b7940fde Add test jobs for arm64 architecture (#76)
* Update build-tool-packages.yml

* Update build-tool-packages.yml

* Update build-tool-packages.yml

* added RUNNER_TYPE

---------

Co-authored-by: aparnajyothi-y <147696841+aparnajyothi-y@users.noreply.github.com>
Co-authored-by: gowridurgad <gowridurga@github.com>
2024-07-09 09:46:50 -05:00
HarithaVattikuti
94d413c5d2 Add win arm64 package availability check (#77) 2024-07-09 09:02:48 -05:00
aparnajyothi-y
6d641c49d7 Fix for windows arm64 node js package (7z) file (#75)
* Update build-tool-packages.yml

* Update and rename build-tool-packages.yml to build-tool-packages.ymll

* Rename build-tool-packages.ymll to build-tool-packages.yml
2024-06-18 12:10:29 -05:00
aparnajyothi-y
447803d00a Architecture update for the test cases of darwin based on macos-14 configuration update (#73)
* macos-latest-large update

* Update build-tool-packages.yml

* Update build-tool-packages.yml

* Update build-tool-packages.yml

* Update build-tool-packages.yml

* Update build-tool-packages.yml

* Update build-tool-packages.yml

* Update build-tool-packages.yml

* Update build-tool-packages.yml

* Update build-tool-packages.yml

* Update build-tool-packages.yml

* Update build-tool-packages.yml

* Update build-tool-packages.yml

* Update build-tool-packages.yml

* Update build-tool-packages.yml
2024-04-29 08:38:37 -05:00
HarithaVattikuti
b549ccbeee Fix for windows arm64 node js package (7z) file (#72)
* Update build-tool-packages.yml

* Fix for arm64 node
2024-03-28 23:04:25 -05:00
aparnajyothi-y
760646fc29 Add support for arm64 packaging on linux and windows for setup-node (#68)
* arm64 packagging on setup-node

* if condition change

* adding arm64 for entire windows and linux

* error fix

* asser install
2024-03-18 08:21:09 -05:00
Dmitry Shibanov
a8a2c841ba Add automatic build of arm64 for macOS (#66) 2023-11-07 11:51:31 +01:00
Dmitry Shibanov
6fbb1f0f20 Add logic to generate hash file (#65) 2023-09-21 15:34:23 +02:00
Marko Zivic
b964a9871b Merge pull request #62 from erik-bershel/rename-VE-to-RI
Rename 'virtual-environments' repo to 'runner-images'
2022-12-27 10:48:32 +01:00
Marko Zivic
d4cf796ec9 Merge pull request #61 from e-korolevskii/patch-1
Update CODEOWNERS
2022-12-27 09:25:14 +01:00
Erik Bershel
b8e79c3d16 Rename 'virtual-environments' repo to 'runner-images' 2022-12-26 13:23:01 +01:00
Evgenii Korolevskii
b43c6cc8fd Update CODEOWNERS 2022-12-26 13:17:25 +01:00
MaksimZhukov
5810329d19 Introduce reusable workflows into versions repositories (#60) 2022-12-02 12:36:59 +01:00
Aleksandr Chebotov
896369fc7d Replace set output (#59) 2022-10-28 18:08:30 +02:00
Aleksandr Chebotov
d25937e581 Replace var $GITHUB_OUTPUT to $env:GITHUB_OUTPUT (#58) 2022-10-28 17:34:40 +02:00
Aleksandr Chebotov
c08a90cad6 Update workflow tasks (#57) 2022-10-28 14:39:22 +02:00
Aleksandr Chebotov
2c15878a9d Update SLACK_CHANNEL_HOOK secret (#56) 2022-09-08 10:37:51 +02:00
Dusko Dobranic
7b3aff2ad5 Merge pull request #55 from actions/xamarin-update-channel
Update Xamarin channel link
2022-08-10 09:29:20 +02:00
Aleksandr Chebotov
81e64845b7 Update Xamarin channel link 2022-08-10 09:08:34 +02:00
Mikhail Timofeev
56f47ea626 Merge pull request #54 from actions/miketimofeev-patch-1
Change macOS toolset to version 12 in xamarin parser
2022-06-01 17:07:28 +04:00
14 changed files with 526 additions and 17 deletions

2
.github/CODEOWNERS vendored
View File

@@ -1 +1 @@
* @actions/virtual-environments-owners
* @actions/setup-actions-team

View File

@@ -0,0 +1,306 @@
# This reusable workflow is used by actions/*-versions repositories
# It is designed to
# - build and test new versions of a tool (Go, Node)
# - publish a release with a new tool version
# The GITHUB_TOKEN secret is used to trigger workflow runs and publish releases
name: Generate tool packages
on:
workflow_call:
inputs:
tool-name:
description: "Tool name to build and upload. Supported values are: 'go' and 'node'"
required: true
type: string
tool-version:
description: "Tool version to build and upload"
required: true
type: string
publish-release:
description: "Whether to publish releases"
required: true
type: boolean
defaults:
run:
shell: pwsh
jobs:
build:
name: Build ${{ inputs.tool-name }} ${{ inputs.tool-version }} [${{ matrix.platform }}] [${{ matrix.architecture }}]
runs-on: ${{ matrix.os }}
env:
ARTIFACT_NAME: ${{ inputs.tool-name }}-${{ inputs.tool-version }}-${{ matrix.platform }}-${{ matrix.architecture }}
excludewinarm: ${{ !(inputs.tool-name == 'node' && inputs['tool-version'] < '20.0.0' && matrix.architecture == 'arm64' && matrix.platform == 'win32') }}
strategy:
fail-fast: false
matrix:
platform: [linux, darwin, win32]
architecture: [x64, arm64]
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Build ${{ inputs.tool-name }} ${{ inputs.tool-version }}
run: |
./builders/build-${{ inputs.tool-name }}.ps1 -Version ${{ inputs.tool-version }} `
-Platform ${{ matrix.platform }} `
-Architecture ${{ matrix.architecture }}
- name: Publish artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ runner.temp }}/artifact
build-arm:
name: Build ${{ inputs.tool-name }} ${{ inputs.tool-version }} [${{ matrix.platform }}] [${{ matrix.architecture }}]
runs-on: windows-latest
if: (inputs.tool-name == 'go') || (inputs.tool-name == 'node' && inputs['tool-version'] > '20.0.0')
env:
ARTIFACT_NAME: ${{ inputs.tool-name }}-${{ inputs.tool-version }}-${{ matrix.platform }}-${{ matrix.architecture }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
platform: win32
architecture: arm64
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Build ${{ inputs.tool-name }} ${{ inputs.tool-version }}
if: env.excludewinarm == 'true'
run: |
./builders/build-${{ inputs.tool-name }}.ps1 -Version ${{ inputs.tool-version }} `
-Platform ${{ matrix.platform }} `
-Architecture ${{ matrix.architecture }}
- name: Publish artifact
if: env.excludewinarm == 'true'
uses: actions/upload-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ runner.temp }}/artifact
test:
name: Test ${{ inputs.tool-name }} ${{ inputs.tool-version }} [${{ matrix.platform }}] [${{ matrix.architecture }}]
needs: build
runs-on: ${{ matrix.os }}
env:
ARTIFACT_NAME: ${{ inputs.tool-name }}-${{ inputs.tool-version }}-${{ matrix.platform }}-${{ matrix.architecture }}
excludewinarm: ${{ !(inputs.tool-name == 'node' && inputs['tool-version'] < '20.0.0' && matrix.architecture == 'arm64' && matrix.platform == 'win32') }}
RUNNER_TYPE: ${{ matrix.runner_type }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
platform: linux
architecture: x64
- os: macos-13
platform: darwin
architecture: x64
- os: windows-latest
platform: win32
architecture: x64
- os: setup-actions-ubuntu-arm64-2-core
platform: linux
architecture: arm64
runner_type: self-hosted
- os: macos-latest
platform: darwin
architecture: arm64
- os: setup-actions-windows-arm64-4-core
platform: win32
architecture: arm64
runner_type: self-hosted
steps:
- name: Setup Environment on Windows ARM64 Runner
if: matrix.os == 'setup-actions-windows-arm64-4-core'
shell: powershell
run: |
# Install Chocolatey
Set-ExecutionPolicy Bypass -Scope Process -Force
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
echo "C:\ProgramData\Chocolatey\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
# Install PowerShell
choco install powershell-core -y
echo "C:\Program Files\PowerShell\7" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
# Install Git
choco install git -y
echo "C:\Program Files\Git\cmd" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
# Install 7-Zip
choco install 7zip -y
echo "C:\ProgramData\chocolatey\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
- name: checkout
if: env.excludewinarm == 'true'
uses: actions/checkout@v4
with:
submodules: true
- name: Fully cleanup the toolcache directory before testing
if: env.excludewinarm == 'true'
run: ./helpers/clean-toolcache.ps1 -ToolName "${{ inputs.tool-name }}"
- name: Download artifact
if: env.excludewinarm == 'true'
uses: actions/download-artifact@v4
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ runner.temp }}/${{ env.ARTIFACT_NAME }}
- name: Extract files
if: env.excludewinarm == 'true'
run: |
if ('${{ matrix.platform }}' -eq 'win32') {
if ('${{ inputs.tool-name }}' -eq 'node') {
$artifactName = "${{ env.ARTIFACT_NAME }}.7z"
} elseif ('${{ inputs.tool-name }}' -eq 'go') {
$artifactName = "${{ env.ARTIFACT_NAME }}.zip"
} else {
Write-Host "Unsupported tool - ${{ inputs.tool-name }}"
exit 1
}
7z.exe x "$artifactName" -y | Out-Null
} else {
$artifactName = "${{ env.ARTIFACT_NAME }}.tar.gz"
tar -xzf $artifactName
}
working-directory: ${{ runner.temp }}/${{ env.ARTIFACT_NAME }}
- name: Apply build artifact to the local machine
if: env.excludewinarm == 'true'
run: |
if ('${{ matrix.platform }}' -eq 'win32') { powershell ./setup.ps1 }
else {
sh ./setup.sh
}
working-directory: ${{ runner.temp }}/${{ env.ARTIFACT_NAME }}
- name: Setup Node.js ${{ inputs.tool-version }}
if: env.excludewinarm == 'true' && inputs.tool-name == 'node'
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.tool-version }}
- name: Setup Go ${{ inputs.tool-version }}
if: inputs.tool-name == 'go'
uses: actions/setup-go@v5
with:
go-version: ${{ inputs.tool-version }}
- name: Wait for the logs
if: env.excludewinarm == 'true'
run: |
Write-Host "Fake step that does nothing"
Write-Host "We need it because log from the previous step 'Setup ${{ inputs.tool-name }}' is not available here yet."
Write-Host "In testing step we analyze build log of 'Setup ${{ inputs.tool-name }}' task"
Write-Host "to determine if ${{ inputs.tool-name }} version was consumed from cache or if it was downloaded"
for ($i = 0; $i -lt 200; $i++) { Get-Random }
- name: Run tests
if: env.excludewinarm == 'true'
env:
VERSION: ${{ inputs.tool-version }}
run: |
Install-Module Pester -Force -Scope CurrentUser -SkipPublisherCheck
Import-Module Pester
$toolName = (Get-Culture).TextInfo.ToTitleCase("${{ inputs.tool-name }}")
Invoke-Pester -Script ./$toolName.Tests.ps1 -EnableExit
working-directory: ./tests
publish_release:
name: Publish release
if: inputs.publish-release
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
- name: Generate release body
id: generate-release-body
run: |
if ('${{ inputs.tool-name }}' -eq 'node') {
$releaseBody = 'Node.js ${{ inputs.tool-version }}'
} else {
$releaseBody = 'Go ${{ inputs.tool-version }}'
}
echo "RELEASE_BODY=$releaseBody" >> $env:GITHUB_OUTPUT
- name: Publish Release
id: create_release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: |
tag_name="${{ inputs.tool-version }}-${{ github.run_id }}"
gh release create "$tag_name" \
--repo="$GITHUB_REPOSITORY" \
--title="${{ inputs.tool-version }}" \
--notes="${{ steps.generate-release-body.outputs.RELEASE_BODY }}"
release_id=$(gh release view "$tag_name" --repo "$GITHUB_REPOSITORY" --json databaseId --jq '.databaseId')
echo "id=$release_id" >> $GITHUB_OUTPUT
- name: Generate hash for packages
run: |
$childItems = Get-Childitem -Path '.'
$childItems | Foreach-Object {
$packageObj = Get-Childitem -Path $_.FullName | Select-Object -First 1
Write-Host "Package: $($packageObj.Name)"
$actualHash = (Get-FileHash -Path $packageObj.FullName -Algorithm sha256).Hash
$hashString = "$actualHash $($packageObj.Name)"
Write-Host "$hashString"
Add-Content -Path ./hashes.sha256 -Value "$hashString"
}
- name: Upload release assets
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const fs = require('fs');
for (let artifactDir of fs.readdirSync('.')) {
let artifactName = fs.lstatSync(artifactDir).isDirectory() ? fs.readdirSync(`${artifactDir}`)[0] : artifactDir;
console.log(`Upload ${artifactName} asset`);
github.rest.repos.uploadReleaseAsset({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: ${{ steps.create_release.outputs.id }},
name: artifactName,
data: fs.lstatSync(artifactDir).isDirectory() ? fs.readFileSync(`./${artifactDir}/${artifactName}`) : fs.readFileSync(`./${artifactName}`).toString()
});
}
trigger_pr:
name: Trigger "Create Pull Request" workflow
needs: publish_release
runs-on: ubuntu-latest
steps:
- name: Trigger "Create Pull Request" workflow
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'create-pr.yml',
ref: 'main'
});

View File

@@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install Pester
shell: pwsh
@@ -20,4 +20,4 @@ jobs:
run: |
Import-Module Pester
Import-Module Assert
Invoke-Pester -EnableExit
Invoke-Pester -EnableExit

View File

@@ -0,0 +1,43 @@
# This reusable workflow is used by actions/*-versions repositories
# It is designed to create a PR with update of versions-manifest.json when a new release is published
# The GITHUB_TOKEN secret is used to create versions-manifest.json and publish related PR
name: Create Pull Request
on:
workflow_call:
inputs:
tool-name:
description: 'Name of the tool for which PR is created'
required: true
type: string
defaults:
run:
shell: pwsh
jobs:
create_pr:
name: Create Pull Request
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Create versions-manifest.json
run: |
./helpers/packages-generation/manifest-generator.ps1 -RepositoryFullName "$env:GITHUB_REPOSITORY" `
-GitHubAccessToken "${{ secrets.GITHUB_TOKEN }}" `
-OutputFile "./versions-manifest.json" `
-ConfigurationFile "./config/${{ inputs.tool-name }}-manifest-config.json"
- name: Create GitHub PR
run: |
$formattedDate = Get-Date -Format "MM/dd/yyyy"
./helpers/github/create-pull-request.ps1 `
-RepositoryFullName "$env:GITHUB_REPOSITORY" `
-AccessToken "${{ secrets.GITHUB_TOKEN }}" `
-BranchName "update-versions-manifest-file" `
-CommitMessage "Update versions-manifest" `
-PullRequestTitle "[versions-manifest] Update for release from ${formattedDate}" `
-PullRequestBody "Update versions-manifest.json for release from ${formattedDate}"

View File

@@ -0,0 +1,109 @@
# This reusable workflow is used by actions/*-versions repositories
# It is designed to check for new versions of a tool (Python, Node, etc.)
# The 'SLACK_CHANNEL_URL' secret must be added to the repository containing the caller workflow
# in order to publish messages to Slack.
# The 'Get Available Tools Versions - Publishing Approval' environment must be created in the repository containing the caller workflow
# The 'trigger_builds' job requires manual approval
# The GITHUB_TOKEN secret is used to cancel and trigger workflow runs
name: Get new tool versions
on:
workflow_call:
inputs:
tool-name:
description: 'Name of the tool for which versions are searched'
required: true
type: string
image-url:
description: 'Tool image to be attached to Slack posts'
required: true
type: string
defaults:
run:
shell: pwsh
jobs:
find_new_versions:
name: Find new versions
runs-on: ubuntu-latest
outputs:
versions_output: ${{ steps.Get_new_versions.outputs.TOOL_VERSIONS }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- id: Get_new_versions
name: Get new versions
run: ./helpers/get-new-tool-versions/get-new-tool-versions.ps1 -ToolName ${{ inputs.tool-name }}
check_new_versions:
name: Check new versions
runs-on: ubuntu-latest
needs: find_new_versions
env:
TOOL_VERSIONS: ${{needs.find_new_versions.outputs.versions_output}}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Check Versions
if: env.TOOL_VERSIONS == ''
run: |
Write-Host "No new versions were found"
Import-Module "./helpers/github/github-api.psm1"
$gitHubApi = Get-GitHubApi -RepositoryFullName "$env:GITHUB_REPOSITORY" `
-AccessToken "${{ secrets.GITHUB_TOKEN }}"
$gitHubApi.CancelWorkflow("$env:GITHUB_RUN_ID")
Start-Sleep -Seconds 60
- name: Send Slack notification
run: |
$pipelineUrl = "$env:GITHUB_SERVER_URL/$env:GITHUB_REPOSITORY/actions/runs/$env:GITHUB_RUN_ID"
$message = "The following versions of '${{ inputs.tool-name }}' are available to upload: ${{ env.TOOL_VERSIONS }}\nLink to the pipeline: $pipelineUrl"
./helpers/get-new-tool-versions/send-slack-notification.ps1 -Url "${{ secrets.SLACK_CHANNEL_URL }}" `
-ToolName "${{ inputs.tool-name }}" `
-ImageUrl "${{ inputs.image-url }}" `
-Text "$message"
trigger_builds:
name: Trigger builds
runs-on: ubuntu-latest
needs: [find_new_versions, check_new_versions]
env:
TOOL_VERSIONS: ${{needs.find_new_versions.outputs.versions_output}}
environment: Get Available Tools Versions - Publishing Approval
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Trigger "Build ${{ inputs.tool-name }} packages" workflow
run: |
$workflowFileName = "build-${{ inputs.tool-name }}-packages.yml".ToLower()
./helpers/github/run-ci-builds.ps1 -RepositoryFullName "$env:GITHUB_REPOSITORY" `
-AccessToken "${{ secrets.GITHUB_TOKEN }}" `
-WorkflowFileName "$workflowFileName" `
-WorkflowDispatchRef "main" `
-ToolVersions "${{ env.TOOL_VERSIONS }}" `
-PublishReleases "true"
check_build:
name: Check build for failures
runs-on: ubuntu-latest
needs: [find_new_versions, check_new_versions, trigger_builds]
if: failure()
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Send Slack notification if build fails
run: |
$pipelineUrl = "$env:GITHUB_SERVER_URL/$env:GITHUB_REPOSITORY/actions/runs/$env:GITHUB_RUN_ID"
$message = "The build of the '${{ inputs.tool-name }}' detection pipeline failed :progress-error:\nLink to the pipeline: $pipelineUrl"
./helpers/get-new-tool-versions/send-slack-notification.ps1 -Url "${{ secrets.SLACK_CHANNEL_URL }}" `
-ToolName "${{ inputs.tool-name }}" `
-Text "$message" `
-ImageUrl "${{ inputs.image-url }}"

View File

@@ -42,7 +42,7 @@ jobs:
name: 'Searching for new versions of ${{ matrix.tool.name }}'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- id: get-new-tool-versions
name: Get new tool versions
run: |
@@ -51,7 +51,7 @@ jobs:
-ReleasesUrl ${{ matrix.tool.releases-url }} `
-FilterParameter ${{ matrix.tool.filter-parameter }} `
-FilterArch ${{ matrix.tool.filter-arch }}
echo "::set-output name=versions-output::$versionsOutput"
echo "versions-output=$versionsOutput" >> $env:GITHUB_OUTPUT
- name: Check versions
if: steps.get-new-tool-versions.outputs.versions-output == ''
run: Write-Host "No new versions found"
@@ -59,7 +59,7 @@ jobs:
name: Send Slack notification
if: steps.get-new-tool-versions.outputs.versions-output != ''
with:
url: ${{ secrets.SLACK_CHANNEL_URL }}
url: ${{ secrets.SLACK_CHANNEL_HOOK }}
tool-name: '${{ matrix.tool.name }}'
tool-version: ${{ steps.get-new-tool-versions.outputs.versions-output }}
image-url: '${{ matrix.tool.image }}'
@@ -71,7 +71,7 @@ jobs:
needs: [find-new-tool-versions]
if: failure()
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- id: get-failed-jobs
name: Get failed jobs
run: |
@@ -79,11 +79,11 @@ jobs:
$failedJobs = (Invoke-RestMethod -Uri $jobs_url).jobs |
Where-Object conclusion -eq "failure" |
ForEach-Object {"\n\t" + $_.name.split(" ")[-1] + ": $($_.html_url)"}
echo "::set-output name=failed-jobs::$failedJobs"
echo "failed-jobs=$failedJobs" >> $env:GITHUB_OUTPUT
- uses: ./.github/actions/send-slack-notification
name: Send Slack notification about failure
with:
url: ${{ secrets.SLACK_CHANNEL_URL }}
url: ${{ secrets.SLACK_CHANNEL_HOOK }}
tool-name: 'Tool name'
pipeline-url: '$env:GITHUB_SERVER_URL/$env:GITHUB_REPOSITORY/actions/runs/$env:GITHUB_RUN_ID'
text: "Missing toolset tool versions checker pipeline has failed jobs:/n/t${{ steps.get-failed-jobs.outputs.failed-jobs }}"
text: "Missing toolset tool versions checker pipeline has failed jobs:/n/t${{ steps.get-failed-jobs.outputs.failed-jobs }}"

51
.github/workflows/validate-manifest.yml vendored Normal file
View File

@@ -0,0 +1,51 @@
# This reusable workflow is used by actions/*-versions repositories
# It is designed to validate the versions-manifest.json file
# The 'SLACK_CHANNEL_URL' secret must be added to the repository containing the caller workflow
# in order to publish messages to Slack
name: Validate manifest
on:
workflow_call:
inputs:
tool-name:
description: 'Name of the tool for which manifest is validated'
required: true
type: string
image-url:
description: 'Tool image to be attached to Slack posts'
required: true
type: string
defaults:
run:
shell: pwsh
jobs:
validation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Validate manifest
run: .\helpers\packages-generation\manifest-validator.ps1 -ManifestPath '.\versions-manifest.json'
check_build:
name: Check validation for failures
runs-on: ubuntu-latest
needs: [validation]
if: failure()
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Send Slack notification if validation fails
run: |
$pipelineUrl = "$env:GITHUB_SERVER_URL/$env:GITHUB_REPOSITORY/actions/runs/$env:GITHUB_RUN_ID"
$message = "The validation of ${{ inputs.tool-name }} manifest failed. \nLink to the pipeline: $pipelineUrl"
.\helpers\get-new-tool-versions\send-slack-notification.ps1 -Url "${{ secrets.SLACK_CHANNEL_URL }}" `
-ToolName "${{ inputs.tool-name }}" `
-Text "$message" `
-ImageUrl "${{ inputs.image-url }}"

View File

@@ -1,5 +1,5 @@
# Common tools for generation of packages in the actions/*-versions repositories
This repository contains PowerShell modules that are used to generate packages for Actions. The packages are consumed by the images generated through [actions/virtual-environments](https://github.com/actions/virtual-environments) and some of the setup-* Actions
This repository contains PowerShell modules that are used to generate packages for Actions. The packages are consumed by the images generated through [actions/runner-images](https://github.com/actions/runner-images) and some of the setup-* Actions
## Contribution
Contributions are welcome! See [Contributor's Guide](./CONTRIBUTING.md) for more details about contribution process and code structure

View File

@@ -21,8 +21,7 @@ $VersionsToBuild = $VersionsFromDist | Where-Object { $VersionsFromManifest -not
if ($VersionsToBuild) {
$availableVersions = $VersionsToBuild -join ", "
Write-Host "The following versions are available to build:`n${availableVersions}"
Write-Host "::set-output name=TOOL_VERSIONS::${availableVersions}"
Write-Host "##vso[task.setvariable variable=TOOL_VERSIONS;isOutput=true]${availableVersions}"
"TOOL_VERSIONS=${availableVersions}" >> $env:GITHUB_OUTPUT
} else {
Write-Host "There aren't versions to build"
}

View File

@@ -16,7 +16,7 @@ function Search-ToolsVersionsNotOnImage {
$_.$FilterParameter.split(".")[0,1] -join"."
}
} | Select-Object -Unique
$toolsetUrl = "https://raw.githubusercontent.com/actions/virtual-environments/main/images/win/toolsets/toolset-2022.json"
$toolsetUrl = "https://raw.githubusercontent.com/actions/runner-images/main/images/win/toolsets/toolset-2022.json"
$latestMinorVersion = (Invoke-RestMethod $toolsetUrl).toolcache |
Where-Object {$_.name -eq $ToolName -and $_.arch -eq $FilterArch} |
ForEach-Object {$_.versions.Replace("*","0")} |

View File

@@ -6,7 +6,7 @@ function Search-XamarinVersionsNotOnImage {
$xamarinReleases = (Invoke-RestMethod $ReleasesUrl).items
$filteredReleases = $xamarinReleases | Where-Object {$_.name -in $FilterProducts.name} | Sort-Object name | Select-Object name, version
$toolsetUrl = "https://raw.githubusercontent.com/actions/virtual-environments/main/images/macos/toolsets/toolset-12.json"
$toolsetUrl = "https://raw.githubusercontent.com/actions/runner-images/main/images/macos/toolsets/toolset-12.json"
$uploadedReleases = (Invoke-RestMethod $toolsetUrl).xamarin
$releasesOnImage = @()
foreach ($FilterProduct in $FilterProducts) {

View File

@@ -22,7 +22,7 @@ if ($ToolName -in "Python", "PyPy", "Node", "Go") {
}
if ($ToolName -eq "Xamarin") {
$xamarinReleases = "http://aka.ms/manifest/stable"
$xamarinReleases = "http://aka.ms/manifest/stable-2022"
$xamarinProducts = @(
[PSCustomObject] @{name = 'Mono Framework'; property = 'mono-versions'}
[PSCustomObject] @{name = 'Xamarin.Android'; property = 'android-versions'}

View File

@@ -77,6 +77,7 @@ Describe "Build-VersionsManifest" {
$assets = @(
@{ name = "python-3.8.3-linux-16.04-x64.tar.gz"; browser_download_url = "fake_url"; }
@{ name = "python-3.8.3-linux-18.04-x64.tar.gz"; browser_download_url = "fake_url"; }
@{ name = "hashes.sha256"; browser_download_url = "fake_url"; }
)
$configuration = @{
regex = "python-\d+\.\d+\.\d+-(\w+)-([\w\.]+)?-?(x\d+)";

View File

@@ -67,7 +67,7 @@ function Build-VersionsManifest {
$ltsStatus = Get-VersionLtsStatus -Version $versionKey -LtsRules $ltsRules
$stable = $version.PreReleaseLabel ? $false : $true
[array]$releaseAssets = $release.assets | ForEach-Object { New-AssetItem -ReleaseAsset $_ -Configuration $Configuration }
[array]$releaseAssets = $release.assets | Where { $_.Name -ne "hashes.sha256" } | ForEach-Object { New-AssetItem -ReleaseAsset $_ -Configuration $Configuration }
$versionHash = [PSCustomObject]@{}
$versionHash | Add-Member -Name "version" -Value $versionKey -MemberType NoteProperty