-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
337 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: CD Check Pipeline | ||
|
||
concurrency: | ||
group: cd-check-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
merge_group: | ||
|
||
pull_request: | ||
branches: | ||
- "release" | ||
- "release/*" | ||
types: | ||
- opened | ||
- synchronize | ||
|
||
jobs: | ||
build-linux-x86_64: | ||
name: "Linux x86_64: Build" | ||
uses: ./.github/workflows/build.yml | ||
with: | ||
os: warp-ubuntu-latest-x64-4x | ||
secrets: | ||
cachix-token: "${{ secrets.CACHIX_AUTH_TOKEN }}" | ||
|
||
build-linux-aarch64: | ||
name: "Linux aarch64: Build" | ||
uses: ./.github/workflows/build.yml | ||
with: | ||
os: warp-ubuntu-latest-arm64-8x | ||
secrets: | ||
cachix-token: "${{ secrets.CACHIX_AUTH_TOKEN }}" | ||
|
||
build-macos-aarch64: | ||
name: "MacOS aarch64: Build" | ||
uses: ./.github/workflows/build.yml | ||
with: | ||
os: warp-macos-latest-arm64-6x | ||
secrets: | ||
cachix-token: "${{ secrets.CACHIX_AUTH_TOKEN }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: CD Release Pipeline | ||
|
||
concurrency: | ||
group: cd-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
push: | ||
branches: ["add-cd"] | ||
tags: | ||
- "*/*" | ||
|
||
jobs: | ||
extract-version: | ||
name: "Extract target and version" | ||
runs-on: ubuntu-latest | ||
outputs: | ||
target: ${{ steps.extract.outputs.target }} | ||
major: ${{ steps.extract.outputs.major }} | ||
minor: ${{ steps.extract.outputs.minor }} | ||
patch: ${{ steps.extract.outputs.patch }} | ||
steps: | ||
- name: Set $USER if needed | ||
run: | | ||
if [ -z "$USER" ]; then | ||
echo "USER=runner" >> "$GITHUB_ENV" | ||
fi | ||
- uses: actions/checkout@v4 | ||
- uses: cachix/install-nix-action@v25 | ||
with: | ||
nix_path: nixpkgs=channel:nixos-23.11 | ||
- uses: cachix/cachix-action@v14 | ||
with: | ||
name: apibara-public | ||
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}" | ||
- id: extract | ||
run: nix develop .#ci --accept-flake-config -c extract-version-from-tag | ||
|
||
release: | ||
name: "${{ needs.extract-version.outputs.target }}: Release" | ||
needs: extract-version | ||
uses: ./.github/workflows/cd-release.yml | ||
if: ${{ needs.extract-version.outputs.target != '' }} | ||
with: | ||
target: ${{ needs.extract-version.outputs.target }} | ||
major: ${{ needs.extract-version.outputs.major }} | ||
minor: ${{ needs.extract-version.outputs.minor }} | ||
patch: ${{ needs.extract-version.outputs.patch }} | ||
secrets: | ||
cachix-token: "${{ secrets.CACHIX_AUTH_TOKEN }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
name: Release a target | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
target: | ||
required: true | ||
type: string | ||
major: | ||
required: true | ||
type: string | ||
minor: | ||
required: true | ||
type: string | ||
patch: | ||
required: true | ||
type: string | ||
secrets: | ||
cachix-token: | ||
required: true | ||
|
||
jobs: | ||
# Step 1: build the target for all platforms | ||
|
||
build-linux-x86_64: | ||
name: "Linux x86_64: Build" | ||
uses: ./.github/workflows/build.yml | ||
with: | ||
os: warp-ubuntu-latest-x64-4x | ||
target: ${{ inputs.target }} | ||
secrets: | ||
cachix-token: "${{ secrets.cachix-token }}" | ||
|
||
build-linux-aarch64: | ||
name: "Linux aarch64: Build" | ||
uses: ./.github/workflows/build.yml | ||
with: | ||
os: warp-ubuntu-latest-arm64-8x | ||
target: ${{ inputs.target }} | ||
secrets: | ||
cachix-token: "${{ secrets.cachix-token }}" | ||
|
||
build-macos-aarch64: | ||
name: "MacOS aarch64: Build" | ||
uses: ./.github/workflows/build.yml | ||
with: | ||
os: warp-macos-latest-arm64-6x | ||
target: ${{ inputs.target }} | ||
secrets: | ||
cachix-token: "${{ secrets.cachix-token }}" | ||
|
||
# Step 2a: create release archive for all platforms | ||
|
||
build-linux-x86_64-archive: | ||
name: "Linux x86_64: Build archive" | ||
needs: build-linux-x86_64 | ||
uses: ./.github/workflows/build.yml | ||
with: | ||
os: warp-ubuntu-latest-x64-4x | ||
target: ${{ inputs.target }}-archive | ||
artifact_name: "${{ inputs.target }}-x86_64-linux" | ||
secrets: | ||
cachix-token: "${{ secrets.cachix-token }}" | ||
|
||
build-linux-aarch64-archive: | ||
name: "Linux aarch64: Build archive" | ||
needs: build-linux-aarch64 | ||
uses: ./.github/workflows/build.yml | ||
with: | ||
os: warp-ubuntu-latest-arm64-8x | ||
target: ${{ inputs.target }}-archive | ||
artifact_name: "${{ inputs.target }}-aarch64-linux" | ||
secrets: | ||
cachix-token: "${{ secrets.cachix-token }}" | ||
|
||
build-macos-aarch64-archive: | ||
name: "MacOS aarch64: Build archive" | ||
needs: build-macos-aarch64 | ||
uses: ./.github/workflows/build.yml | ||
with: | ||
os: warp-macos-latest-arm64-6x | ||
target: ${{ inputs.target }}-archive | ||
artifact_name: "${{ inputs.target }}-aarch64-macos" | ||
secrets: | ||
cachix-token: "${{ secrets.cachix-token }}" | ||
|
||
# Step 2b: create Docker image for all (Linux) platforms. | ||
|
||
build-linux-x86_64-image: | ||
name: "Linux x86_64: Build Docker image" | ||
needs: build-linux-x86_64 | ||
uses: ./.github/workflows/build.yml | ||
with: | ||
os: warp-ubuntu-latest-x64-4x | ||
target: ${{ inputs.target }}-image | ||
artifact_name: "${{ inputs.target }}-x86_64-image" | ||
secrets: | ||
cachix-token: "${{ secrets.cachix-token }}" | ||
|
||
build-linux-aarch64-image: | ||
name: "Linux aarch64: Build Docker image" | ||
needs: build-linux-aarch64 | ||
uses: ./.github/workflows/build.yml | ||
with: | ||
os: warp-ubuntu-latest-arm64-8x | ||
target: ${{ inputs.target }}-image | ||
artifact_name: "${{ inputs.target }}-aarch64-image" | ||
secrets: | ||
cachix-token: "${{ secrets.cachix-token }}" | ||
|
||
# Step 3a: publish docker images | ||
|
||
publish-docker-images: | ||
name: "Publish Docker images" | ||
needs: [build-linux-x86_64-image, build-linux-aarch64-image] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download Docker image for x86_64 | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: ${{ inputs.target }}-x86_64-image | ||
- name: Download Docker image for aarch64 | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: ${{ inputs.target }}-aarch64-image | ||
- name: Publish Docker images | ||
run: | | ||
ls -l $PWD | ||
# Step 3b: publish binaries | ||
|
||
publish-binaries: | ||
name: "Publish binaries" | ||
needs: | ||
- build-linux-x86_64-archive | ||
- build-linux-aarch64-archive | ||
- build-macos-aarch64-archive | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Publish binaries | ||
run: | | ||
echo "Publishing binaries ${{ inputs.target }}:${{ inputs.major }}.${{ inputs.minor }}.${{ inputs.patch }}" |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.