Compare commits

..

7 Commits

Author SHA1 Message Date
gowridurgad
7a7977206b Update build-tool-packages.yml 2024-06-24 12:00:26 +05:30
gowridurgad
e0f35e2f09 Update build-tool-packages.yml 2024-06-24 11:30:00 +05:30
gowridurgad
0c2adaf4d3 Update build-tool-packages.yml 2024-06-24 11:28:46 +05:30
gowridurgad
a72200de65 Update build-tool-packages.yml 2024-06-24 11:24:42 +05:30
gowridurgad
b26793719f Update build-tool-packages.yml 2024-06-24 11:22:44 +05:30
gowridurgad
0ac28d3fc6 Update build-tool-packages.yml 2024-06-24 11:19:26 +05:30
gowridurgad
5b692dccd3 Update build-tool-packages.yml 2024-06-24 10:19:37 +05:30
8 changed files with 42 additions and 98 deletions

View File

@@ -1,14 +0,0 @@
# 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'

View File

@@ -1,3 +1,4 @@
# This reusable workflow is used by actions/*-versions repositories # This reusable workflow is used by actions/*-versions repositories
# It is designed to # It is designed to
# - build and test new versions of a tool (Go, Node) # - build and test new versions of a tool (Go, Node)
@@ -27,91 +28,68 @@ defaults:
jobs: jobs:
build: build:
name: Build ${{ inputs.tool-name }} ${{ inputs.tool-version }} [${{ matrix.platform }}] [${{ matrix.architecture }}] name: Build ${{ inputs.tool-name }} ${{ inputs.tool-version }} [${{ matrix.platform }}] [${{ matrix.architecture }}]
runs-on: ubuntu-22.04 runs-on: ubuntu-latest
env: env:
ARTIFACT_NAME: ${{ inputs.tool-name }}-${{ inputs.tool-version }}-${{ matrix.platform }}-${{ matrix.architecture }} 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: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
platform: [linux, darwin, win32] platform: [linux, darwin, win32]
architecture: [x64, arm64] architecture: [x64, arm64]
steps: steps:
- name: checkout - uses: actions/checkout@v4
if: env.excludewinarm == 'true'
uses: actions/checkout@v4
with: with:
submodules: true submodules: true
- name: Build ${{ inputs.tool-name }} ${{ inputs.tool-version }} - name: Build ${{ inputs.tool-name }} ${{ inputs.tool-version }}
if: env.excludewinarm == 'true'
run: | run: |
./builders/build-${{ inputs.tool-name }}.ps1 -Version ${{ inputs.tool-version }} ` ./builders/build-${{ inputs.tool-name }}.ps1 -Version ${{ inputs.tool-version }} `
-Platform ${{ matrix.platform }} ` -Platform ${{ matrix.platform }} `
-Architecture ${{ matrix.architecture }} -Architecture ${{ matrix.architecture }}
- name: Publish artifact - name: Publish artifact
if: env.excludewinarm == 'true' uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with: with:
name: ${{ env.ARTIFACT_NAME }} name: ${{ env.ARTIFACT_NAME }}
path: ${{ runner.temp }}/artifact path: ${{ runner.temp }}/artifact
test: test:
name: Test ${{ inputs.tool-name }} ${{ inputs.tool-version }} [${{ matrix.platform }}] [${{ matrix.architecture }}] name: Test ${{ inputs.tool-name }} ${{ inputs.tool-version }} [${{ matrix.platform }}]
needs: build needs: build
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
env: env:
ARTIFACT_NAME: ${{ inputs.tool-name }}-${{ inputs.tool-version }}-${{ matrix.platform }}-${{ matrix.architecture }} ARTIFACT_NAME: ${{ inputs.tool-name }}-${{ inputs.tool-version }}-${{ matrix.platform }}-${{ matrix.arch }}
excludewinarm: ${{ !(inputs.tool-name == 'node' && inputs['tool-version'] < '20.0.0' && matrix.architecture == 'arm64' && matrix.platform == 'win32') }}
RUNNER_TYPE: ${{ matrix.runner_type }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
include: include:
- os: ubuntu-latest - os: ubuntu-latest
platform: linux platform: linux
architecture: x64 arch: x64
- os: macos-13
platform: darwin
architecture: x64
- os: windows-latest
platform: win32
architecture: x64
- os: ubuntu-22.04-arm
platform: linux
architecture: arm64
- os: macos-latest - os: macos-latest
platform: darwin platform: darwin
architecture: arm64 arch: arm64
- os: windows-11-arm - os: windows-latest
platform: win32 platform: win32
architecture: arm64 arch: x64
steps: steps:
- name: checkout - uses: actions/checkout@v3
if: env.excludewinarm == 'true'
uses: actions/checkout@v4
with: with:
submodules: true submodules: true
- name: Fully cleanup the toolcache directory before testing - name: Fully cleanup the toolcache directory before testing
if: env.excludewinarm == 'true'
run: ./helpers/clean-toolcache.ps1 -ToolName "${{ inputs.tool-name }}" run: ./helpers/clean-toolcache.ps1 -ToolName "${{ inputs.tool-name }}"
- name: Download artifact - name: Download artifact
if: env.excludewinarm == 'true' uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with: with:
name: ${{ env.ARTIFACT_NAME }} path: ${{ runner.temp }}
path: ${{ runner.temp }}/${{ env.ARTIFACT_NAME }}
- name: Extract files - name: Extract files
if: env.excludewinarm == 'true'
run: | run: |
if ('${{ matrix.platform }}' -eq 'win32') { if ('${{ matrix.platform }}' -eq 'win32') {
if ('${{ inputs.tool-name }}' -eq 'node') { if ('${{ inputs.tool-name }}' -eq 'node') {
@@ -131,28 +109,23 @@ jobs:
working-directory: ${{ runner.temp }}/${{ env.ARTIFACT_NAME }} working-directory: ${{ runner.temp }}/${{ env.ARTIFACT_NAME }}
- name: Apply build artifact to the local machine - name: Apply build artifact to the local machine
if: env.excludewinarm == 'true'
run: | run: |
if ('${{ matrix.platform }}' -eq 'win32') { powershell ./setup.ps1 } if ('${{ matrix.platform }}' -eq 'win32') { powershell ./setup.ps1 } else { sh ./setup.sh }
else {
sh ./setup.sh
}
working-directory: ${{ runner.temp }}/${{ env.ARTIFACT_NAME }} working-directory: ${{ runner.temp }}/${{ env.ARTIFACT_NAME }}
- name: Setup Node.js ${{ inputs.tool-version }} - name: Setup Node.js ${{ inputs.tool-version }}
if: env.excludewinarm == 'true' && inputs.tool-name == 'node' if: inputs.tool-name == 'node'
uses: actions/setup-node@v4 uses: actions/setup-node@v3
with: with:
node-version: ${{ inputs.tool-version }} node-version: ${{ inputs.tool-version }}
- name: Setup Go ${{ inputs.tool-version }} - name: Setup Go ${{ inputs.tool-version }}
if: inputs.tool-name == 'go' if: inputs.tool-name == 'go'
uses: actions/setup-go@v5 uses: actions/setup-go@v3
with: with:
go-version: ${{ inputs.tool-version }} go-version: ${{ inputs.tool-version }}
- name: Wait for the logs - name: Wait for the logs
if: env.excludewinarm == 'true'
run: | run: |
Write-Host "Fake step that does nothing" 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 "We need it because log from the previous step 'Setup ${{ inputs.tool-name }}' is not available here yet."
@@ -161,7 +134,6 @@ jobs:
for ($i = 0; $i -lt 200; $i++) { Get-Random } for ($i = 0; $i -lt 200; $i++) { Get-Random }
- name: Run tests - name: Run tests
if: env.excludewinarm == 'true'
env: env:
VERSION: ${{ inputs.tool-version }} VERSION: ${{ inputs.tool-version }}
run: | run: |
@@ -177,7 +149,7 @@ jobs:
needs: test needs: test
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/download-artifact@v4 - uses: actions/download-artifact@v3
- name: Generate release body - name: Generate release body
id: generate-release-body id: generate-release-body
@@ -191,18 +163,14 @@ jobs:
- name: Publish Release - name: Publish Release
id: create_release id: create_release
uses: actions/create-release@v1
env: env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash with:
run: | tag_name: ${{ inputs.tool-version }}-${{ github.run_id }}
tag_name="${{ inputs.tool-version }}-${{ github.run_id }}" release_name: ${{ inputs.tool-version }}
gh release create "$tag_name" \ body: |
--repo="$GITHUB_REPOSITORY" \ ${{ steps.generate-release-body.outputs.RELEASE_BODY }}
--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 - name: Generate hash for packages
run: | run: |
@@ -217,7 +185,7 @@ jobs:
} }
- name: Upload release assets - name: Upload release assets
uses: actions/github-script@v7 uses: actions/github-script@v6
with: with:
github-token: ${{ secrets.GITHUB_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
script: | script: |
@@ -241,7 +209,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Trigger "Create Pull Request" workflow - name: Trigger "Create Pull Request" workflow
uses: actions/github-script@v7 uses: actions/github-script@v6
with: with:
github-token: ${{ secrets.GITHUB_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
script: | script: |

View File

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

View File

@@ -20,7 +20,7 @@ jobs:
name: Create Pull Request name: Create Pull Request
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v3
with: with:
submodules: true submodules: true
@@ -40,4 +40,4 @@ jobs:
-BranchName "update-versions-manifest-file" ` -BranchName "update-versions-manifest-file" `
-CommitMessage "Update versions-manifest" ` -CommitMessage "Update versions-manifest" `
-PullRequestTitle "[versions-manifest] Update for release from ${formattedDate}" ` -PullRequestTitle "[versions-manifest] Update for release from ${formattedDate}" `
-PullRequestBody "Update versions-manifest.json for release from ${formattedDate}" -PullRequestBody "Update versions-manifest.json for release from ${formattedDate}"

View File

@@ -30,7 +30,7 @@ jobs:
outputs: outputs:
versions_output: ${{ steps.Get_new_versions.outputs.TOOL_VERSIONS }} versions_output: ${{ steps.Get_new_versions.outputs.TOOL_VERSIONS }}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v3
with: with:
submodules: true submodules: true
@@ -45,7 +45,7 @@ jobs:
env: env:
TOOL_VERSIONS: ${{needs.find_new_versions.outputs.versions_output}} TOOL_VERSIONS: ${{needs.find_new_versions.outputs.versions_output}}
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v3
with: with:
submodules: true submodules: true
@@ -75,7 +75,7 @@ jobs:
TOOL_VERSIONS: ${{needs.find_new_versions.outputs.versions_output}} TOOL_VERSIONS: ${{needs.find_new_versions.outputs.versions_output}}
environment: Get Available Tools Versions - Publishing Approval environment: Get Available Tools Versions - Publishing Approval
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v3
with: with:
submodules: true submodules: true
@@ -95,7 +95,7 @@ jobs:
needs: [find_new_versions, check_new_versions, trigger_builds] needs: [find_new_versions, check_new_versions, trigger_builds]
if: failure() if: failure()
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v3
with: with:
submodules: true submodules: true

View File

@@ -42,7 +42,7 @@ jobs:
name: 'Searching for new versions of ${{ matrix.tool.name }}' name: 'Searching for new versions of ${{ matrix.tool.name }}'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v3
- id: get-new-tool-versions - id: get-new-tool-versions
name: Get new tool versions name: Get new tool versions
run: | run: |
@@ -71,7 +71,7 @@ jobs:
needs: [find-new-tool-versions] needs: [find-new-tool-versions]
if: failure() if: failure()
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v2
- id: get-failed-jobs - id: get-failed-jobs
name: Get failed jobs name: Get failed jobs
run: | run: |

View File

@@ -24,7 +24,7 @@ jobs:
validation: validation:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v3
with: with:
submodules: true submodules: true
@@ -37,7 +37,7 @@ jobs:
needs: [validation] needs: [validation]
if: failure() if: failure()
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v3
with: with:
submodules: true submodules: true

View File

@@ -1,15 +1,5 @@
# Common tools for generation of packages in the actions/*-versions repositories # 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/runner-images](https://github.com/actions/runner-images) 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
## 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
```
## Contribution ## Contribution
Contributions are welcome! See [Contributor's Guide](./CONTRIBUTING.md) for more details about contribution process and code structure Contributions are welcome! See [Contributor's Guide](./CONTRIBUTING.md) for more details about contribution process and code structure