Skip to content

Commit

Permalink
add release-binary reusable flow
Browse files Browse the repository at this point in the history
  • Loading branch information
pirog committed Nov 19, 2024
1 parent 18d3b65 commit 2ea0a24
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 20 deletions.
65 changes: 47 additions & 18 deletions .github/workflows/dev-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
arch: ${{ matrix.arch }}
edge: true
fatcore: ${{ matrix.fatcore }}
filename: lando-${{ matrix.os }}-${{ matrix.arch }}${{ matrix.fatcore == false && '-slim' || '' }}-${{ github.sha }}
filename: lando-${{ matrix.os }}-${{ matrix.arch }}-${{ github.sha }}${{ matrix.fatcore == false && '-slim' || '' }}
node-version: "20"
os: ${{ matrix.os }}

Expand All @@ -42,15 +42,18 @@ jobs:
# - lando-linux-arm64-${{ github.sha }}
# - lando-macos-arm64-${{ github.sha }}
# - lando-win-arm64-${{ github.sha }}.exe

# - lando-linux-x64-${{ github.sha }}
# - lando-macos-x64-${{ github.sha }}
# - lando-win-x64-${{ github.sha }}.exe
# - lando-linux-arm64-slim-${{ github.sha }}
# - lando-macos-arm64-slim-${{ github.sha }}
# - lando-win-arm64-slim-${{ github.sha }}.exe
- lando-linux-x64-slim-${{ github.sha }}
- lando-macos-x64-slim-${{ github.sha }}
- lando-win-x64-slim-${{ github.sha }}.exe

# - lando-linux-arm64-${{ github.sha }}-slim
# - lando-macos-arm64-${{ github.sha }}-slim
# - lando-win-arm64-${{ github.sha }}-slim.exe

- lando-linux-x64-${{ github.sha }}-slim
- lando-macos-x64-${{ github.sha }}-slim
- lando-win-x64-${{ github.sha }}-slim.exe

with:
download-pattern: packaged-lando-*
Expand All @@ -64,19 +67,45 @@ jobs:
keylocker-cert-sha1-hash: ${{ secrets.KEYLOCKER_CERT_SHA1_HASH }}
keylocker-keypair-alias: ${{ secrets.KEYLOCKER_KEYPAIR_ALIAS }}

release-binary:
uses: ./.github/workflows/release-binary.yml
needs:
- sign
strategy:
fail-fast: false
matrix:
file:
# - source: lando-linux-arm64-${{ github.sha }}
# destination: lando-linux-arm64-${{ github.ref_name }}
# - source: lando-macos-arm64-${{ github.sha }}
# destination: lando-macos-arm64-${{ github.ref_name }}
# - source: lando-win-arm64-${{ github.sha }}.exe
# destination: lando-win-arm64-${{ github.ref_name }}.exe

# - source: lando-linux-x64-${{ github.sha }}
# destination: lando-linux-x64-${{ github.ref_name }}
# - source: lando-macos-x64-${{ github.sha }}
# destination: lando-macos-x64-${{ github.ref_name }}
# - source: lando-win-x64-${{ github.sha }}.exe
# destination: lando-win-x64-${{ github.ref_name }}.exe

# - name: Rename as needed
# shell: bash
# run: |
# # naming things
# mkdir -p releases
# cp ${{ steps.code-sign-action.outputs.file }} releases/${{ matrix.result }}
# cp releases/${{ matrix.result }} "releases/$(echo ${{ matrix.result }} | sed 's/${{ github.ref_name }}/latest/;')"
# cp releases/${{ matrix.result }} "releases/$(echo ${{ matrix.result }} | sed 's/${{ github.ref_name }}/dev/;')"
# - source: lando-linux-arm64-${{ github.sha }}-slim
# destination: lando-linux-arm64-${{ github.ref_name }}-slim
# - source: lando-macos-arm64-${{ github.sha }}-slim
# destination: lando-macos-arm64-${{ github.ref_name }}-slim
# - source: lando-win-arm64-${{ github.sha }}-slim.exe
# destination: lando-win-arm64-${{ github.ref_name }}-slim.exe

# # exec and confirm
# chmod +x releases/*
# ls -lsa releases
- source: lando-linux-x64-${{ github.sha }}-slim
destination: lando-linux-x64-${{ github.ref_name }}-slim
- source: lando-macos-x64-${{ github.sha }}-slim
destination: lando-macos-x64-${{ github.ref_name }}-slim
- source: lando-win-x64-${{ github.sha }}-slim.exe
destination: lando-win-x64-${{ github.ref_name }}-slim.exe
with:
destination: ${{ matrix.destination }}
download-pattern: signed-lando-*
source: ${{ matrix.source }}

# - name: Configure S3 Credentials
# uses: aws-actions/configure-aws-credentials@v4
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/release-binary.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Release Binary

on:
workflow_call:
inputs:
destination:
description: The name of the resulting binary to upload
required: true
type: string
download-name:
default:
description: The artifact name to download for checksumming
required: false
type: string
download-pattern:
default:
description: The artifact pattern to download for checksumming
required: false
type: string
source:
description: The name of the source binary to use
required: true
type: string

jobs:
release-binary:
runs-on: ubuntu-24.04
env:
TERM: xterm
steps:
- name: Create and enter path
run: |
mkdir -p /tmp/${{ github.sha }}
cd /tmp/${{ github.sha }}
- name: Download binaries
id: download-artifacts
uses: actions/download-artifact@v4
with:
name: ${{ inputs.download-name }}
merge-multiple: true
path: /tmp/${{ github.sha }}
pattern: ${{ inputs.download-pattern }}
- name: Mod as needed
run: |
mkdir -p /tmp/release-binary
cp -rf "/tmp/${{ github.sha }}/${{ inputs.source }}" "/tmp/release-binary/${{ inputs.destination }}"
chmod +x /tmp/release-binary/*
ls -lsa /tmp/release-binary
- name: Upload signed binaries
uses: actions/upload-artifact@v4
with:
name: release-binary-${{ inputs.destination }}
overwrite: true
path: /tmp/release-binary/${{ inputs.destination }}
if-no-files-found: error
retention-days: 1
2 changes: 0 additions & 2 deletions .github/workflows/sign-binary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ jobs:
env:
TERM: xterm
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Create and enter path
run: |
mkdir -p /tmp/${{ github.sha }}
Expand Down

0 comments on commit 2ea0a24

Please sign in to comment.