Skip to content

Build, Test, and Publish a Release #95

Build, Test, and Publish a Release

Build, Test, and Publish a Release #95

Workflow file for this run

name: Build, Test, and Publish a Release
on:
workflow_dispatch:
inputs: {}
jobs:
prep:
runs-on: ubuntu-latest
outputs:
branch: ${{ steps.whichver.outputs.branch }}
scm_revision: ${{ steps.whatrev.outputs.rev }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Determine package version
shell: bash
run: |
branch=${GITHUB_REF#refs/heads/}
echo branch="${branch}" >> $GITHUB_OUTPUT
id: whichver
build-macos-x86_64:
runs-on: ['macos-14']
needs: prep
steps:
- uses: actions/checkout@v4
with:
repository: edgedb/edgedb-pkg
ref: master
path: edgedb-pkg
- name: Update Homebrew before installing Rust toolchain
run: |
# Homebrew renamed `rustup-init` to `rustup`:
# https://github.com/Homebrew/homebrew-core/pull/177840
# But the GitHub Action runner is not updated with this change yet.
# This caused the later `brew update` in step `Build` to relink Rust
# toolchain executables, overwriting the custom toolchain installed by
# `dtolnay/rust-toolchain`. So let's just run `brew update` early.
brew update
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@d0e72ca3bfdc51937a4f81431ccbed269ef9f2a2
if: true
with:
components: "cargo,rustc,rust-std"
toolchain: "stable"
targets: "x86_64-apple-darwin"
- name: Set up Python
uses: actions/setup-python@v5
if: true
with:
python-version: "3.x"
- name: Install dependencies
if: true
run: |
env HOMEBREW_NO_AUTO_UPDATE=1 brew install libmagic
- name: Build
env:
SRC_REF: "${{ needs.prep.outputs.branch }}"
BUILD_IS_RELEASE: "true"
PKG_REVISION: "<current-date>"
PKG_PLATFORM: "macos"
PKG_PLATFORM_VERSION: "x86_64"
PKG_PLATFORM_ARCH: "x86_64"
PACKAGE: edgedbpkg.edgedbcli:EdgeDBCLI
METAPKG_GIT_CACHE: disabled
BUILD_GENERIC: true
run: |
edgedb-pkg/integration/macos/build.sh
- uses: actions/upload-artifact@v4
with:
name: builds-macos-x86_64
path: artifacts/macos-x86_64/
build-macos-aarch64:
runs-on: ['macos-14']
needs: prep
steps:
- uses: actions/checkout@v4
with:
repository: edgedb/edgedb-pkg
ref: master
path: edgedb-pkg
- name: Update Homebrew before installing Rust toolchain
run: |
# Homebrew renamed `rustup-init` to `rustup`:
# https://github.com/Homebrew/homebrew-core/pull/177840
# But the GitHub Action runner is not updated with this change yet.
# This caused the later `brew update` in step `Build` to relink Rust
# toolchain executables, overwriting the custom toolchain installed by
# `dtolnay/rust-toolchain`. So let's just run `brew update` early.
brew update
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@d0e72ca3bfdc51937a4f81431ccbed269ef9f2a2
if: true
with:
components: "cargo,rustc,rust-std"
toolchain: "stable"
targets: "aarch64-apple-darwin"
- name: Set up Python
uses: actions/setup-python@v5
if: true
with:
python-version: "3.x"
- name: Install dependencies
if: true
run: |
env HOMEBREW_NO_AUTO_UPDATE=1 brew install libmagic
- name: Build
env:
SRC_REF: "${{ needs.prep.outputs.branch }}"
BUILD_IS_RELEASE: "true"
PKG_REVISION: "<current-date>"
PKG_PLATFORM: "macos"
PKG_PLATFORM_VERSION: "aarch64"
PKG_PLATFORM_ARCH: "aarch64"
PACKAGE: edgedbpkg.edgedbcli:EdgeDBCLI
METAPKG_GIT_CACHE: disabled
BUILD_GENERIC: true
run: |
edgedb-pkg/integration/macos/build.sh
- uses: actions/upload-artifact@v4
with:
name: builds-macos-aarch64
path: artifacts/macos-aarch64/
publish-macos-x86_64:
needs: [build-macos-x86_64]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: builds-macos-x86_64
path: artifacts/macos-x86_64
- uses: actions/checkout@v4
with:
repository: edgedb/edgedb-pkg
ref: master
path: edgedb-pkg
- name: Describe
id: describe
uses: edgedb/edgedb-pkg/integration/actions/describe-artifact@master
with:
target: macos-x86_64
- name: Publish
uses: edgedb/edgedb-pkg/integration/linux/upload/linux-x86_64@master
env:
PKG_PLATFORM: "macos"
PKG_PLATFORM_VERSION: "x86_64"
PKG_VERSION_SLOT: "${{ steps.describe.outputs.version-slot }}"
PACKAGE_UPLOAD_SSH_KEY: "${{ secrets.PACKAGE_UPLOAD_SSH_KEY }}"
publish-macos-aarch64:
needs: [build-macos-aarch64]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: builds-macos-aarch64
path: artifacts/macos-aarch64
- uses: actions/checkout@v4
with:
repository: edgedb/edgedb-pkg
ref: master
path: edgedb-pkg
- name: Describe
id: describe
uses: edgedb/edgedb-pkg/integration/actions/describe-artifact@master
with:
target: macos-aarch64
- name: Publish
uses: edgedb/edgedb-pkg/integration/linux/upload/linux-x86_64@master
env:
PKG_PLATFORM: "macos"
PKG_PLATFORM_VERSION: "aarch64"
PKG_VERSION_SLOT: "${{ steps.describe.outputs.version-slot }}"
PACKAGE_UPLOAD_SSH_KEY: "${{ secrets.PACKAGE_UPLOAD_SSH_KEY }}"