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

chore(release): atomic build and push jobs #2564

Merged
merged 12 commits into from
Feb 3, 2024
119 changes: 54 additions & 65 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release
name: Atomic Build and Release

on:
schedule:
Expand All @@ -8,36 +8,43 @@ on:
push:
tags:
- "*"
branches:
- tycho/release-atomically

greyscaled marked this conversation as resolved.
Show resolved Hide resolved
greyscaled marked this conversation as resolved.
Show resolved Hide resolved
env:
PYTHON_VERSION: "3.11"
MATURIN_VERSION: "1.4.0"
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
MATURIN_USERNAME: "seanglaredb"
PROTOC: "${{ github.workspace }}/deps/protoc/bin/protoc"
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK

concurrency:
group: release-${{ github.ref }}
cancel-in-progress: true
group: release-${{ github.ref }}
cancel-in-progress: true

jobs:
atomic-release:
# This creates a node in the DAG so that all of the "push" tasks
# can depend on all build tasks.
name: Atomic Release Release
name: Atomic Release
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
needs:
- python-linux
- python-macos
- python-windows
- python-macos
- kernel-dist
- node-build
steps:
greyscaled marked this conversation as resolved.
Show resolved Hide resolved
- run: sleep 1

########################################################################
##
## Kernel Release
##
########################################################################
########################################################################
##
## Kernel Release
##
########################################################################

kernel-dist:
strategy:
Expand Down Expand Up @@ -76,19 +83,18 @@ jobs:
name: dist-${{ matrix.target }}
path: ./target/dist/
- name: Post to slack
uses: slackapi/slack-github-action@v1.24.0
uses: slackapi/slack-github-action@v1.25.0
if: ${{ always() }}
with:
payload: |
{
"text": "Build release binary result (${{ matrix.target }}): ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
"text": "Build Kernel Binary (${{ matrix.target }}): ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
}


docker-push:
name: Build and Push Docker Image
runs-on: ubuntu-latest-8-cores
needs: atomic-build
needs: [atomic-release]
permissions:
id-token: write # required to use OIDC auth
contents: write # required to checkout code
Expand All @@ -107,7 +113,6 @@ jobs:
- run: ./scripts/build-and-push-images.sh
# TODO: this should pull the binary that was built in kernel-dist.


kernel-push:
name: Push Kernel Release
runs-on: ubuntu-latest
Expand Down Expand Up @@ -136,19 +141,19 @@ jobs:
name: releases
path: ./dist
- name: Post to slack
uses: slackapi/slack-github-action@v1.24.0
uses: slackapi/slack-github-action@v1.25.0
if: ${{ always() }}
with:
payload: |
{
"text": "Publish release binary result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
"text": "Publish Kernal Binary: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
}

########################################################################
##
## Python Bindings
##
########################################################################
########################################################################
##
## Python Bindings
##
########################################################################

python-linux:
name: Build Python Bindings (linux ${{ matrix.target }})
Expand All @@ -159,10 +164,6 @@ jobs:
fail-fast: true
matrix:
target: [x86_64]
env:
PYTHON_VERSION: "3.11"
MATURIN_VERSION: "1.4.0"
PROTOC: "${{ github.workspace }}/deps/protoc/bin/protoc"
steps:
- uses: actions/checkout@v4
- uses: extractions/setup-just@v1
Expand All @@ -187,12 +188,12 @@ jobs:
path: dist

- name: Post to slack
uses: slackapi/slack-github-action@v1.24.0
uses: slackapi/slack-github-action@v1.25.0
if: ${{ always() }}
with:
payload: |
{
"text": "Python bindings build result (linux ${{ matrix.target }}): ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
"text": "Build Python Bindings (linux ${{ matrix.target }}): ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
}

python-windows:
Expand All @@ -204,10 +205,6 @@ jobs:
fail-fast: true
matrix:
target: [x64]
env:
PYTHON_VERSION: "3.11"
MATURIN_VERSION: "1.4.0"
PROTOC: "${{ github.workspace }}/deps/protoc/bin/protoc"
steps:
- uses: actions/checkout@v4
- uses: extractions/setup-just@v1
Expand All @@ -232,15 +229,14 @@ jobs:
name: wheels
path: bindings/python/dist
greyscaled marked this conversation as resolved.
Show resolved Hide resolved
- name: Post to slack
uses: slackapi/slack-github-action@v1.24.0
uses: slackapi/slack-github-action@v1.25.0
if: ${{ always() }}
with:
payload: |
{
"text": "Python bindings build result (windows ${{ matrix.target }}): ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
"text": "Build Python Bindings (windows ${{ matrix.target }}): ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
}


python-macos:
name: Build Python Bindings (macos ${{ matrix.config.target }})
runs-on: ${{ matrix.config.runner }}
Expand All @@ -250,27 +246,23 @@ jobs:
fail-fast: true
matrix:
config:
- target: x86_64-apple-darwin
runner: macos-13-large
- target: aarch64-apple-darwin
runner: macos-13-xlarge
env:
PYTHON_VERSION: "3.11"
MATURIN_VERSION: "1.4.0"
PROTOC: "${{ github.workspace }}/deps/protoc/bin/protoc"
- target: x86_64-apple-darwin
runner: macos-13-large
- target: aarch64-apple-darwin
runner: macos-13-xlarge
steps:
- uses: actions/checkout@v4
- uses: extractions/setup-just@v1
with:
just-version: "1.23.0"
- name: install protoc
run: just protoc
- run: just protoc
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.config.target }}
args: --release ${{ matrix.config.target }} --out dist
working-directory: bindings/python
container: "off"
Expand All @@ -279,28 +271,23 @@ jobs:
with:
name: wheels
path: bindings/python/dist

- name: Post to slack
uses: slackapi/slack-github-action@v1.24.0
uses: slackapi/slack-github-action@v1.25.0
if: ${{ always() }}
with:
payload: |
{
"text": "Python bindings build result (macos ${{ matrix.config.target }}): ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
"text": "Build Python Bindings (macos ${{ matrix.config.target }}): ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
}


python-push:
name: Push Python Bindings
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
runs-on: ubuntu-latest
needs: [atomic-release]
permissions:
contents: read
env:
PYTHON_VERSION: "3.11"
MATURIN_VERSION: "1.4.0"
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
MATURIN_USERNAME: "seanglaredb"
steps:
- uses: actions/download-artifact@v3
with:
Expand All @@ -313,21 +300,24 @@ jobs:
command: upload
args: --skip-existing *
- name: Post to slack
uses: slackapi/slack-github-action@v1.24.0
uses: slackapi/slack-github-action@v1.25.0
if: ${{ always() }}
with:
payload: |
{
"text": "Python bindings publish result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
"text": "Push Python Bindings: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
}

########################################################################
##
## Node.js Release Process
##
########################################################################
########################################################################
##
## Node.js Release Process
##
########################################################################

node-build:
defaults:
run:
working-directory: bindings/nodejs
permissions:
contents: write
id-token: write
Expand Down Expand Up @@ -441,15 +431,14 @@ jobs:
path: bindings/nodejs/${{ env.APP_NAME }}.*.node
if-no-files-found: error
- name: Post to slack
uses: slackapi/slack-github-action@v1.24.0
uses: slackapi/slack-github-action@v1.25.0
if: ${{ always() }}
with:
payload: |
{
"text": "Node.js bindings build result (${{ matrix.settings.target }}): ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
"text": "Build Node.JS Bindings (stable - ${{ matrix.settings.target }} - node@18): ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
}


node-push:
name: Push Node.js Bindings
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
Expand Down Expand Up @@ -493,10 +482,10 @@ jobs:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Post to slack
uses: slackapi/slack-github-action@v1.24.0
uses: slackapi/slack-github-action@v1.25.0
if: ${{ always() }}
with:
payload: |
{
"text": "Node.js bindings publish result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
"text": "Push Node.js Bindings: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}"
}
Loading
Loading