Skip to content

Create nightly build release #767

Create nightly build release

Create nightly build release #767

Workflow file for this run

name: Create nightly build release
on:
workflow_dispatch:
schedule:
- cron: "0 23 * * *"
jobs:
set-env:
runs-on: ubuntu-latest
outputs:
version: ${{ env.HQ_VERSION }}
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Set HQ nightly version
run: |
echo "HQ_VERSION=nightly-$(date +'%Y-%m-%d')-${{ github.sha }}" >> $GITHUB_ENV
- name: Print HQ nightly version
run: |
echo "HQ version: ${{ env.HQ_VERSION }}"
build-binaries-x64:
runs-on: ubuntu-latest
needs: [ set-env ]
# Use a container with GLIBC 2.17
container: quay.io/pypa/manylinux2014_x86_64
steps:
- name: Show GLIBC
run: ldd --version
- name: Checkout sources
uses: actions/checkout@v3
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.59.0
override: true
- uses: Swatinem/rust-cache@v1
with:
key: x64
- name: Compile
uses: actions-rs/cargo@v1
env:
HQ_BUILD_VERSION: ${{ needs.set-env.outputs.version }}
with:
command: build
args: --release
- name: Prepare archive
id: archive
run: |
export ARCHIVE_NAME=hq-${{ needs.set-env.outputs.version }}-linux-x64.tar.gz
tar -czvf $ARCHIVE_NAME -C target/release hq
echo "::set-output name=archive-name::$ARCHIVE_NAME"
- name: Store archive
uses: actions/upload-artifact@v2
with:
name: archive-x64
path: ${{ steps.archive.outputs.archive-name }}
build-binaries-powerpc:
runs-on: ubuntu-latest
needs: [ set-env ]
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.59.0
override: true
- uses: Swatinem/rust-cache@v1
with:
key: powerpc64le-unknown-linux-gnu
- name: Compile
uses: actions-rs/cargo@v1
env:
HQ_BUILD_VERSION: ${{ needs.set-env.outputs.version }}
with:
command: build
args: --target powerpc64le-unknown-linux-gnu --no-default-features --release
use-cross: true
- name: Prepare archive
id: archive
run: |
export ARCHIVE_NAME=hq-${{ needs.set-env.outputs.version }}-linux-powerpc64.tar.gz
tar -czvf $ARCHIVE_NAME -C target/powerpc64le-unknown-linux-gnu/release hq
echo "::set-output name=archive-name::$ARCHIVE_NAME"
- name: Store archive
uses: actions/upload-artifact@v2
with:
name: archive-powerpc64
path: ${{ steps.archive.outputs.archive-name }}
build-python-binding:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v3
- uses: messense/maturin-action@v1
with:
maturin-version: latest
manylinux: 2014
command: build
args: --manifest-path crates/pyhq/Cargo.toml --release --out wheels
- name: Upload test artifacts
uses: actions/upload-artifact@v2
with:
name: archive-pyhq
path: wheels/hyperqueue-*.whl
create-tag:
runs-on: ubuntu-latest
needs: [ set-env, build-binaries-x64, build-binaries-powerpc, build-python-binding ]
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Create tag
uses: rickstaa/action-create-tag@v1
with:
tag: nightly
force_push_tag: true
message: Nightly build ${{ needs.set-env.outputs.version }}
create-release:
runs-on: ubuntu-latest
needs: [ set-env, create-tag ]
steps:
- name: Checkout sources
uses: actions/checkout@v3
- name: Generate changelog
run: python3 scripts/extract_changelog.py DEV > generated-changelog.md
- name: Download artifacts
uses: actions/download-artifact@v2
- name: Prepare release name
run: |
echo "RELEASE_NAME=Nightly build $(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Create release
uses: ncipollo/release-action@v1
id: create-release
with:
bodyFile: generated-changelog.md
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
name: ${{ env.RELEASE_NAME }}
prerelease: true
tag: nightly
commit: ${{ github.sha }}
artifacts: archive-*/**
removeArtifacts: true