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

View File

@@ -1,3 +1,4 @@
# This reusable workflow is used by actions/*-versions repositories
# It is designed to
# - build and test new versions of a tool (Go, Node)
@@ -27,115 +28,68 @@ defaults:
jobs:
build:
name: Build ${{ inputs.tool-name }} ${{ inputs.tool-version }} [${{ matrix.platform }}] [${{ matrix.architecture }}]
runs-on: ubuntu-latest
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]
platform: [linux, darwin, win32]
architecture: [x64, arm64]
steps:
- name: checkout
if: env.excludewinarm == 'true'
uses: actions/checkout@v4
- 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
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ runner.temp }}/artifact
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
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 }}
ARTIFACT_NAME: ${{ inputs.tool-name }}-${{ inputs.tool-version }}-${{ matrix.platform }}-${{ matrix.arch }}
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
arch: x64
- os: macos-latest
platform: darwin
architecture: arm64
- os: setup-actions-windows-arm64-4-core
arch: arm64
- os: windows-latest
platform: win32
architecture: arm64
runner_type: self-hosted
arch: x64
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
- uses: actions/checkout@v3
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
uses: actions/download-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ runner.temp }}/${{ env.ARTIFACT_NAME }}
path: ${{ runner.temp }}
- name: Extract files
if: env.excludewinarm == 'true'
run: |
if ('${{ matrix.platform }}' -eq 'win32') {
if ('${{ inputs.tool-name }}' -eq 'node') {
@@ -155,28 +109,23 @@ jobs:
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
}
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
if: inputs.tool-name == 'node'
uses: actions/setup-node@v3
with:
node-version: ${{ inputs.tool-version }}
- name: Setup Go ${{ inputs.tool-version }}
if: inputs.tool-name == 'go'
uses: actions/setup-go@v5
uses: actions/setup-go@v3
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."
@@ -185,7 +134,6 @@ jobs:
for ($i = 0; $i -lt 200; $i++) { Get-Random }
- name: Run tests
if: env.excludewinarm == 'true'
env:
VERSION: ${{ inputs.tool-version }}
run: |
@@ -201,7 +149,7 @@ jobs:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
- uses: actions/download-artifact@v3
- name: Generate release body
id: generate-release-body
@@ -237,7 +185,7 @@ jobs:
}
- name: Upload release assets
uses: actions/github-script@v7
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
@@ -261,7 +209,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Trigger "Create Pull Request" workflow
uses: actions/github-script@v7
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |