Skip to content

release-git: add support for arm64 #99

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/actions/github-release/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ inputs:
git_artifacts_x86_64_workflow_run_id:
description: 'ID of the git-artifacts (x86_64) workflow run'
required: true
git_artifacts_aarch64_workflow_run_id:
description: 'ID of the git-artifacts (aarch64) workflow run'
required: true
outputs:
github-release-url:
description: "The GitHub Release URL"
Expand All @@ -59,7 +62,7 @@ runs:
rev: ${{ inputs.rev }}
check-run-name: "github-release"
title: "Publish ${{ inputs.display-version }} for @${{ inputs.rev }}"
summary: "Downloading the Git artifacts from ${{ inputs.git_artifacts_x86_64_workflow_run_id }} and ${{ inputs.git_artifacts_i686_workflow_run_id }} and publishing them as a new GitHub Release at ${{ inputs.owner }}/${{ inputs.repo }}"
summary: "Downloading the Git artifacts from ${{ inputs.git_artifacts_x86_64_workflow_run_id }}, ${{ inputs.git_artifacts_i686_workflow_run_id }} and ${{ inputs.git_artifacts_aarch64_workflow_run_id }} and publishing them as a new GitHub Release at ${{ inputs.owner }}/${{ inputs.repo }}"
text: "For details, see [this run](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id}})."
details-url: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id}}"
- name: Download bundle-artifacts (needed to push the tag)
Expand Down Expand Up @@ -97,7 +100,8 @@ runs:
artifactsOwner,
artifactsRepo,
${{ inputs.git_artifacts_i686_workflow_run_id }},
${{ inputs.git_artifacts_x86_64_workflow_run_id }}
${{ inputs.git_artifacts_x86_64_workflow_run_id }},
${{ inputs.git_artifacts_aarch64_workflow_run_id }}
)

const sha256sums = sha256sumsFromReleaseNotes(${{ toJSON(inputs.release-notes) }})
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/release-git.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ on:
git_artifacts_x86_64_workflow_run_id:
description: 'ID of the git-artifacts (x86_64) workflow run'
required: true
git_artifacts_aarch64_workflow_run_id:
description: 'ID of the git-artifacts (aarch64) workflow run'
required: true

env:
HOME: "${{github.workspace}}\\home"
Expand All @@ -17,6 +20,7 @@ env:
REPO: git
I686_WORKFLOW_RUN_ID: "${{github.event.inputs.git_artifacts_i686_workflow_run_id}}"
X86_64_WORKFLOW_RUN_ID: "${{github.event.inputs.git_artifacts_x86_64_workflow_run_id}}"
AARCH64_WORKFLOW_RUN_ID: "${{github.event.inputs.git_artifacts_aarch64_workflow_run_id}}"

jobs:
setup:
Expand Down Expand Up @@ -86,7 +90,8 @@ jobs:
context.repo.owner,
context.repo.repo,
process.env.I686_WORKFLOW_RUN_ID,
process.env.X86_64_WORKFLOW_RUN_ID
process.env.X86_64_WORKFLOW_RUN_ID,
process.env.AARCH64_WORKFLOW_RUN_ID
)

core.setOutput('display-version', result.displayVersion)
Expand Down
30 changes: 25 additions & 5 deletions github-release.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ const downloadAndUnZip = async (token, url, name) => {

const architectures = [
{ name: 'x86_64', infix: '-64-bit' },
{ name: 'i686', infix: '-32-bit' }
{ name: 'i686', infix: '-32-bit' },
{ name: 'aarch64', infix: '-arm64' }
]

const artifacts = [
Expand All @@ -96,11 +97,20 @@ const artifactName2Rank = (name) => {
return rank
}

const downloadBundleArtifacts = async (context, token, owner, repo, git_artifacts_i686_workflow_run_id, git_artifacts_x86_64_workflow_run_id) => {
const downloadBundleArtifacts = async (
context,
token,
owner,
repo,
git_artifacts_i686_workflow_run_id,
git_artifacts_x86_64_workflow_run_id,
git_artifacts_aarch64_workflow_run_id
) => {
for (const architecture of architectures) {
const workflowRunId = {
x86_64: git_artifacts_x86_64_workflow_run_id,
i686: git_artifacts_i686_workflow_run_id
i686: git_artifacts_i686_workflow_run_id,
aarch64: git_artifacts_aarch64_workflow_run_id
}[architecture.name]
const downloadURLs = await getWorkflowRunArtifactsURLs(context, token, owner, repo, workflowRunId)
if (architecture.name === 'x86_64') await downloadAndUnZip(token, downloadURLs['bundle-artifacts'], 'bundle-artifacts')
Expand Down Expand Up @@ -162,17 +172,27 @@ const downloadBundleArtifacts = async (context, token, owner, repo, git_artifact
return result
}

const getGitArtifacts = async (context, token, owner, repo, git_artifacts_i686_workflow_run_id, git_artifacts_x86_64_workflow_run_id) => {
const getGitArtifacts = async (
context,
token,
owner,
repo,
git_artifacts_i686_workflow_run_id,
git_artifacts_x86_64_workflow_run_id,
git_artifacts_aarch64_workflow_run_id
) => {
const fs = require('fs')
const result = []
for (const architecture of architectures) {
const workflowRunId = {
x86_64: git_artifacts_x86_64_workflow_run_id,
i686: git_artifacts_i686_workflow_run_id
i686: git_artifacts_i686_workflow_run_id,
aarch64: git_artifacts_aarch64_workflow_run_id
}[architecture.name]

const urls = await getWorkflowRunArtifactsURLs(context, token, owner, repo, workflowRunId)
for (const artifact of artifacts) {
if (architecture.name === 'aarch64' && artifact.name === 'mingit-busybox') continue
const name = `${artifact.name}-${architecture.name}`
context.log(`Downloading ${name}`)
await downloadAndUnZip(token, urls[name], name)
Expand Down