mirror of
https://github.com/actions/versions-package-tools.git
synced 2025-12-10 11:41:23 +00:00
Compare commits
37 Commits
shilovmaks
...
816a9a3331
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
816a9a3331 | ||
|
|
6c48f687bd | ||
|
|
e60ec8ae98 | ||
|
|
db2ae0a36e | ||
|
|
6fdf7f098f | ||
|
|
4ae553a74d | ||
|
|
13ba3fd9e0 | ||
|
|
552a1a5fda | ||
|
|
1e5d44c7a5 | ||
|
|
817eacd539 | ||
|
|
933aacb90a | ||
|
|
d3c3feee4b | ||
|
|
4028baf988 | ||
|
|
d30950623a | ||
|
|
16b7940fde | ||
|
|
94d413c5d2 | ||
|
|
6d641c49d7 | ||
|
|
447803d00a | ||
|
|
b549ccbeee | ||
|
|
760646fc29 | ||
|
|
a8a2c841ba | ||
|
|
6fbb1f0f20 | ||
|
|
b964a9871b | ||
|
|
d4cf796ec9 | ||
|
|
b8e79c3d16 | ||
|
|
b43c6cc8fd | ||
|
|
5810329d19 | ||
|
|
896369fc7d | ||
|
|
d25937e581 | ||
|
|
c08a90cad6 | ||
|
|
2c15878a9d | ||
|
|
7b3aff2ad5 | ||
|
|
81e64845b7 | ||
|
|
56f47ea626 | ||
|
|
c3143dd446 | ||
|
|
31f01aedc7 | ||
|
|
e6dbb79745 |
2
.github/CODEOWNERS
vendored
2
.github/CODEOWNERS
vendored
@@ -1 +1 @@
|
||||
* @actions/virtual-environments-owners
|
||||
* @actions/setup-actions-team
|
||||
|
||||
14
.github/dependabot.yml
vendored
Normal file
14
.github/dependabot.yml
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
# To get started with Dependabot version updates, you'll need to specify which
|
||||
# package ecosystems to update and where the package manifests are located.
|
||||
# Please see the documentation for all configuration options:
|
||||
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
|
||||
|
||||
version: 2
|
||||
updates:
|
||||
# Enable version updates for GitHub Actions
|
||||
- package-ecosystem: 'github-actions'
|
||||
# Workflow files stored in the default location of `.github/workflows`
|
||||
# You don't need to specify `/.github/workflows` for `directory`. You can use `directory: "/"`.
|
||||
directory: '/'
|
||||
schedule:
|
||||
interval: 'weekly'
|
||||
278
.github/workflows/build-tool-packages.yml
vendored
Normal file
278
.github/workflows/build-tool-packages.yml
vendored
Normal file
@@ -0,0 +1,278 @@
|
||||
# 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: ubuntu-22.04
|
||||
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:
|
||||
- name: checkout
|
||||
if: env.excludewinarm == 'true'
|
||||
uses: actions/checkout@v5
|
||||
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-15-intel
|
||||
platform: darwin
|
||||
architecture: x64
|
||||
- os: windows-latest
|
||||
platform: win32
|
||||
architecture: x64
|
||||
- os: ubuntu-22.04-arm
|
||||
platform: linux
|
||||
architecture: arm64
|
||||
- os: macos-latest
|
||||
platform: darwin
|
||||
architecture: arm64
|
||||
- os: windows-11-arm
|
||||
platform: win32
|
||||
architecture: arm64
|
||||
|
||||
steps:
|
||||
- name: checkout
|
||||
if: env.excludewinarm == 'true'
|
||||
uses: actions/checkout@v5
|
||||
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@v5
|
||||
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: Ensure Pester Installed
|
||||
run: |
|
||||
$module = Get-Module -ListAvailable -Name Pester
|
||||
if (-not $module -or ($module.Version -lt [Version]"5.0.0")) {
|
||||
Install-Module Pester -Force -Scope CurrentUser -SkipPublisherCheck
|
||||
}
|
||||
|
||||
- name: Run tests
|
||||
if: env.excludewinarm == 'true'
|
||||
env:
|
||||
VERSION: ${{ inputs.tool-version }}
|
||||
run: |
|
||||
Import-Module Pester
|
||||
$toolName = (Get-Culture).TextInfo.ToTitleCase("${{ inputs.tool-name }}")
|
||||
Invoke-Pester -Configuration @{
|
||||
Run = @{ Path = "./$toolName.Tests.ps1" }
|
||||
Should = @{ ErrorAction = 'Continue' }
|
||||
Output = @{ EnableExit = $true }
|
||||
}
|
||||
working-directory: ./tests
|
||||
|
||||
# - 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 -Configuration @{
|
||||
# Run = @{ Path = "./$toolName.Tests.ps1" }
|
||||
# Should = @{ ErrorAction = 'Continue' }
|
||||
# Output = @{ EnableExit = $true }
|
||||
# }
|
||||
# working-directory: ./tests
|
||||
|
||||
publish_release:
|
||||
name: Publish release
|
||||
if: inputs.publish-release
|
||||
needs: test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/download-artifact@v5
|
||||
|
||||
- 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'
|
||||
});
|
||||
4
.github/workflows/common_tests.yml
vendored
4
.github/workflows/common_tests.yml
vendored
@@ -7,7 +7,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v5
|
||||
|
||||
- name: Install Pester
|
||||
shell: pwsh
|
||||
@@ -20,4 +20,4 @@ jobs:
|
||||
run: |
|
||||
Import-Module Pester
|
||||
Import-Module Assert
|
||||
Invoke-Pester -EnableExit
|
||||
Invoke-Pester -EnableExit
|
||||
|
||||
43
.github/workflows/create-pr-to-update-manifest.yml
vendored
Normal file
43
.github/workflows/create-pr-to-update-manifest.yml
vendored
Normal 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@v5
|
||||
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}"
|
||||
109
.github/workflows/get-new-tool-versions.yml
vendored
Normal file
109
.github/workflows/get-new-tool-versions.yml
vendored
Normal 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@v5
|
||||
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@v5
|
||||
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@v5
|
||||
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@v5
|
||||
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 }}"
|
||||
14
.github/workflows/get-tools-new-versions.yml
vendored
14
.github/workflows/get-tools-new-versions.yml
vendored
@@ -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@v5
|
||||
- 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@v5
|
||||
- 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
51
.github/workflows/validate-manifest.yml
vendored
Normal 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@v5
|
||||
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@v5
|
||||
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 }}"
|
||||
30
README.md
30
README.md
@@ -1,5 +1,29 @@
|
||||
# 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
|
||||
## Recommended permissions
|
||||
|
||||
When using the `versions-package-tools` in your GitHub Actions workflow, it is recommended to set the following permissions to ensure proper functionality:
|
||||
|
||||
```yaml
|
||||
permissions:
|
||||
contents: read # access to read repository's content
|
||||
actions: read # access to reading actions
|
||||
```
|
||||
### Note
|
||||
|
||||
Thank you for your interest in this GitHub action, however, right now we are not taking contributions. Add commentMore actionsAdd commentMore actions
|
||||
|
||||
We continue to focus our resources on strategic areas that help our customers be successful while making developers' lives easier. While GitHub Actions remains a key part of this vision, we are allocating resources towards other areas of Actions and are not taking contributions to this repository at this time. The GitHub public roadmap is the best place to follow along for any updates on features we’re working on and what stage they’re in.
|
||||
|
||||
We are taking the following steps to better direct requests related to GitHub Actions, including:
|
||||
|
||||
1. We will be directing questions and support requests to our [Community Discussions area](https://github.com/orgs/community/discussions/categories/actions)
|
||||
|
||||
2. High Priority bugs can be reported through Community Discussions or you can report these to our support team https://support.github.com/contact/bug-report.
|
||||
|
||||
3. Security Issues should be handled as per our [security.md](security.md)
|
||||
|
||||
We will still provide security updates for this project and fix major breaking changes during this time.
|
||||
|
||||
You are welcome to still raise bugs in this repo.
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
|
||||
@@ -8,13 +8,15 @@ function Search-ToolsVersionsNotOnImage {
|
||||
|
||||
$stableReleases = (Invoke-RestMethod $ReleasesUrl) | Where-Object stable -eq $true
|
||||
$stableReleaseVersions = $stableReleases | ForEach-Object {
|
||||
if ($ToolName -eq "Node") {
|
||||
$_.$FilterParameter.split(".")[0] + ".0"
|
||||
if ($ToolName -eq "Node") {
|
||||
if ($_.lts) {
|
||||
$_.$FilterParameter.split(".")[0] + ".0"
|
||||
}
|
||||
} else {
|
||||
$_.$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")} |
|
||||
|
||||
@@ -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-11.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) {
|
||||
@@ -16,4 +16,4 @@ function Search-XamarinVersionsNotOnImage {
|
||||
'{0,-15} : {1}' -f $_.name, $_.version
|
||||
}
|
||||
return $versionsToAdd
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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'}
|
||||
|
||||
@@ -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+)";
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user