A little bit of simplification for Cargo. (#317) #1
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
name: Postgres NDC build and push binaries with Nix | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- "v*" | |
jobs: | |
build_and_deploy: | |
name: build and deploy | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
connectors: | |
[ | |
{ | |
"build_command": "ndc-postgres-x86_64-linux", | |
"binary_artifact_name": "hasura-postgres-agent-rs", | |
"artifact_path": "result/bin/ndc-postgres", | |
}, | |
{ | |
"build_command": "ndc-cockroach-x86_64-linux", | |
"binary_artifact_name": "hasura-cockroach-agent-rs", | |
"artifact_path": "result/bin/ndc-cockroach", | |
}, | |
{ | |
"build_command": "ndc-citus-x86_64-linux", | |
"binary_artifact_name": "hasura-citus-agent-rs", | |
"artifact_path": "result/bin/ndc-citus", | |
}, | |
] | |
steps: | |
- name: Checkout ποΈ | |
uses: actions/checkout@v4 | |
- name: Install Nix β | |
uses: DeterminateSystems/nix-installer-action@v4 | |
- name: Run the Magic Nix Cache π | |
uses: DeterminateSystems/magic-nix-cache-action@v2 | |
- name: Login to GitHub Container Registry π¦ | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: build the crate using nix π¨ | |
run: nix build .#${{ matrix.connectors.build_command}} --print-build-logs | |
- name: Create release π | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.connectors.binary_artifact_name }} | |
path: ${{ matrix.connectors.artifact_path }} | |
# scream into Slack if something goes wrong | |
- name: Report Status | |
if: always() | |
uses: ravsamhq/notify-slack-action@v2 | |
with: | |
status: ${{ job.status }} | |
notify_when: failure | |
notification_title: "π§ Error on <{repo_url}|{repo}>" | |
message_format: "π΄ *{workflow}* {status_message} for <{repo_url}|{repo}>" | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.BROKEN_BUILD_SLACK_WEBHOOK_URL }} |