Skip to content
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

build: add linux release automation and release automation validation #1185

Open
wants to merge 31 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
2d4b6ff
build: add linux release automation and release automation validation
pendo324 Oct 17, 2024
1098aad
update file list
pendo324 Oct 18, 2024
345c60b
temporariliy ignore ci-docs.yaml changes for CI
pendo324 Oct 18, 2024
8ed01f5
fix syntax error
pendo324 Oct 18, 2024
e78b57f
fix syntax error
pendo324 Oct 18, 2024
47391a6
update linux release workflow
pendo324 Oct 18, 2024
ec497d4
fix permissions
pendo324 Oct 18, 2024
1c23f49
fix action name
pendo324 Oct 18, 2024
ff4069d
add checkout step
pendo324 Oct 18, 2024
c2d1b19
echo version to help with debug
pendo324 Oct 18, 2024
643c691
fix license check
pendo324 Oct 18, 2024
b983863
fix linux permissions
pendo324 Oct 18, 2024
27b54c2
fix version calculation
pendo324 Oct 18, 2024
cc70965
avoid cross-arch golicense installation
pendo324 Oct 18, 2024
b233a0a
use ref instead of ref_name
pendo324 Oct 18, 2024
d55f956
fix version output
pendo324 Oct 18, 2024
4cd592d
fix version conditional
pendo324 Oct 18, 2024
fcce212
use version instead of tag
pendo324 Oct 18, 2024
5aa5bd4
actually fix version
pendo324 Oct 18, 2024
921ec6f
debug logs
pendo324 Oct 18, 2024
6cbc346
simplify
pendo324 Oct 18, 2024
cb46c20
use outputs instead of env
pendo324 Oct 18, 2024
1eadb1e
fix path
pendo324 Oct 18, 2024
3b78663
fix bin path
pendo324 Oct 18, 2024
c4502d7
add debug logs
pendo324 Oct 18, 2024
997591f
fix directory paths
pendo324 Oct 18, 2024
e3815dc
add sudo
pendo324 Oct 18, 2024
ab37436
Merge branch 'main' into release-automation-overhaul-fix
pendo324 Nov 15, 2024
0f92f0e
typo
pendo324 Nov 15, 2024
3a9e63e
fix version extraction logic
pendo324 Nov 15, 2024
28daa2e
update tests to use version instead of tag
pendo324 Nov 15, 2024
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
47 changes: 17 additions & 30 deletions .github/workflows/build-and-test-msi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,19 @@ on:
workflow_dispatch:
inputs:
ref_name:
description: "the ref (tag/branch) to use to extract tag/version"
required: true
type: string
workflow_call:
inputs:
ref_name:
description: "the ref (tag/branch) to use to extract tag/version"
required: true
type: string
version:
description: "override for version, will be used instead of ref if set, used for testing"
required: false
type: string
schedule:
- cron: '0 9 * * *'
env:
Expand All @@ -26,29 +32,10 @@ permissions:
jobs:
get-tag-name:
name: Get tag name
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.check-tag.outputs.tag }}
version: ${{ steps.check-tag.outputs.version }}
steps:
- name: Check tag from workflow input and github ref
id: check-tag
run: |
if [ -n "${{ inputs.ref_name }}" ]; then
tag=${{ inputs.ref_name }}
else
tag=${{ github.ref_name }}
fi
echo "tag=$tag" >> ${GITHUB_OUTPUT}

version=${tag#v}
if [[ $version =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Version matches format: $version"
else
echo "Version $version doesn't match format. Using test version: 0.0.1"
version="0.0.1"
fi
echo "version=$version" >> ${GITHUB_OUTPUT}
uses: ./.github/workflows/get-version-and-tag-for-ref.yaml
with:
ref_name: ${{ inputs.ref_name }}
version: ${{ inputs.version }}

windows-msi-build:
needs: get-tag-name
Expand Down Expand Up @@ -99,13 +86,13 @@ jobs:
$tag="${{ needs.get-tag-name.outputs.tag }}"
powershell .\msi-builder\BuildFinchMSI.ps1 -Version $version
$timestamp=[math]::truncate((Get-Date (Get-Date).ToUniversalTime() -UFormat "%s"))
$unsignedMSI="Finch-$tag-$timestamp.msi"
$unsignedMSI="Finch-$version-$timestamp.msi"
Write-Host "Upload unsigned MSI: $unsignedMSI"

aws s3 cp "./msi-builder/build/Finch-$version.msi" "${{ secrets.WINDOWS_UNSIGNED_BUCKET }}$unsignedMSI" --acl bucket-owner-full-control --no-progress
New-Item -Path "./msi-builder/build/signed/" -ItemType Directory -Force

Write-Host "Attemp to download signed MSI"
Write-Host "Attempt to download signed MSI"
$retryCount = 0
$maxRetries = 20
$delay = 5
Expand All @@ -115,7 +102,7 @@ jobs:
$signedMSI = aws s3 ls ${{ secrets.WINDOWS_SIGNED_BUCKET }} 2>&1 | Where-Object { $_ -match "$unsignedMSI" } | Sort-Object -Descending | Select-Object -First 1 | ForEach-Object { ($_ -split '\s+')[-1] }
if ($signedMSI -and ($signedMSI -notlike "*An error occurred (404) when calling the HeadObject operation*")) {
try {
aws s3 cp "${{ secrets.WINDOWS_SIGNED_BUCKET }}$signedMSI" "./msi-builder/build/signed/Finch-$tag.msi"
aws s3 cp "${{ secrets.WINDOWS_SIGNED_BUCKET }}$signedMSI" "./msi-builder/build/signed/Finch-$version.msi"
break
} catch {
Write-Host "Error during copy: $_"
Expand All @@ -137,8 +124,8 @@ jobs:
aws-region: ${{ secrets.REGION }}
- name: upload signed MSI to S3
run: |
$tag="${{ needs.get-tag-name.outputs.tag }}"
aws s3 cp "./msi-builder/build/signed/Finch-$tag.msi" "s3://${{ secrets.INSTALLER_PRIVATE_BUCKET_NAME }}/Finch-$tag.msi" --no-progress
$version="${{ needs.get-tag-name.outputs.version }}"
aws s3 cp "./msi-builder/build/signed/Finch-$version.msi" "s3://${{ secrets.INSTALLER_PRIVATE_BUCKET_NAME }}/Finch-$version.msi" --no-progress
- name: Remove Finch VM and Clean Up Previous Environment
if: ${{ always() }}
timeout-minutes: 2
Expand Down Expand Up @@ -208,8 +195,8 @@ jobs:
}
- name: Download MSI from S3
run: |
$tag="${{ needs.get-tag-name.outputs.tag }}"
aws s3 cp "s3://${{ secrets.INSTALLER_PRIVATE_BUCKET_NAME }}/Finch-$tag.msi" ./Finch.msi
$version="${{ needs.get-tag-name.outputs.version }}"
aws s3 cp "s3://${{ secrets.INSTALLER_PRIVATE_BUCKET_NAME }}/Finch-$version.msi" ./Finch.msi
- name: Install MSI silently
run: |
Start-Process 'Finch.msi' -ArgumentList '/quiet' -Wait
Expand Down
31 changes: 14 additions & 17 deletions .github/workflows/build-and-test-pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,19 @@ on:
workflow_dispatch:
inputs:
ref_name:
description: "the ref (tag/branch) to use to extract tag/version"
required: true
type: string
workflow_call:
inputs:
ref_name:
description: "the ref (tag/branch) to use to extract tag/version"
required: true
type: string
version:
description: "override for version, will be used instead of ref if set, used for testing"
required: false
type: string
schedule:
- cron: '0 9 * * *'
env:
Expand All @@ -20,19 +26,10 @@ env:
jobs:
get-tag-name:
name: Get tag name
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.check-tag.outputs.tag }}
steps:
- name: Check tag from workflow input and github ref
id: check-tag
run: |
if [ -n "${{ inputs.ref_name }}" ]; then
tag=${{ inputs.ref_name }}
else
tag=${{ github.ref_name }}
fi
echo "tag=$tag" >> ${GITHUB_OUTPUT}
uses: ./.github/workflows/get-version-and-tag-for-ref.yaml
with:
ref_name: ${{ inputs.ref_name }}
version: ${{ inputs.version }}

macos-aarch64-pkg-build:
needs: get-tag-name
Expand All @@ -43,7 +40,7 @@ jobs:
arch: arm64
output_arch: aarch64
version: 14
tag: ${{ needs.get-tag-name.outputs.tag }}
finch_version: ${{ needs.get-tag-name.outputs.version }}

macos-x86-64-pkg-build:
needs: get-tag-name
Expand All @@ -54,7 +51,7 @@ jobs:
arch: amd64
output_arch: x86_64
version: 14
tag: ${{ needs.get-tag-name.outputs.tag }}
finch_version: ${{ needs.get-tag-name.outputs.version }}

macos-aarch64-pkg-test:
strategy:
Expand All @@ -71,7 +68,7 @@ jobs:
arch: arm64
output_arch: aarch64
version: ${{ matrix.version }}
tag: ${{ needs.get-tag-name.outputs.tag }}
finch_version: ${{ needs.get-tag-name.outputs.version }}

macos-x86-64-pkg-test:
strategy:
Expand All @@ -88,4 +85,4 @@ jobs:
arch: amd64
output_arch: x86_64
version: ${{ matrix.version }}
tag: ${{ needs.get-tag-name.outputs.tag }}
finch_version: ${{ needs.get-tag-name.outputs.version }}
18 changes: 18 additions & 0 deletions .github/workflows/ci-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ on:
- '!.github/workflows/e2e-macos.yaml'
- '!.github/workflows/e2e-windows.yaml'
- '!.github/workflows/e2e-linux.yaml'
- '!.github/workflows/release-automation.yaml'
- '!.github/workflows/release-linux.yaml'
- '!.github/workflows/upload-build-to-S3.yaml'
- '!.github/workflows/build-and-test-msi.yaml'
- '!.github/workflows/build-and-test-pkg.yaml'
- '!.github/workflows/ci-release.yaml'
- '!.github/workflows/get-version-and-tag-for-ref.yaml'
- '!.github/workflows/ci-docs.yaml'
- '!CHANGELOG.md'
pull_request:
branches:
- main
Expand All @@ -39,6 +48,15 @@ on:
- '!.github/workflows/e2e-macos.yaml'
- '!.github/workflows/e2e-windows.yaml'
- '!.github/workflows/e2e-linux.yaml'
- '!.github/workflows/release-automation.yaml'
- '!.github/workflows/release-linux.yaml'
- '!.github/workflows/upload-build-to-S3.yaml'
- '!.github/workflows/build-and-test-msi.yaml'
- '!.github/workflows/build-and-test-pkg.yaml'
- '!.github/workflows/ci-release.yaml'
- '!.github/workflows/get-version-and-tag-for-ref.yaml'
- '!.github/workflows/ci-docs.yaml'
- '!CHANGELOG.md'

jobs:
git-secrets:
Expand Down
Loading