Skip to content

build job: update for release 0.9.75 #19

build job: update for release 0.9.75

build job: update for release 0.9.75 #19

Workflow file for this run

# GH workflow to build and publish cargo-nextest release for OpenBSD-stable
name: Build and Publish
on:
# Run with new tag
push:
tags:
- "*.*.*"
permissions:
contents: write
jobs:
build:
name: Build cargo-nextest
runs-on: ubuntu-latest
steps:
# Set NEXTEST_VERSION in env
- name: Set NEXT_VERSION env
run: echo "NEXTEST_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
# Checkout only build script and script for CI
- name: Checkout build script
uses: actions/checkout@v4
with:
sparse-checkout: |
build.sh
ci/openbsd_build.sh
- name: Prepare OpenBSD VM and build
uses: vmactions/openbsd-vm@v1.0.8
with:
usesh: true
sync: rsync
copyback: true
envs: 'NEXTEST_VERSION'
# Install requirements to build cargo-nextest
prepare: pkg_add -I bash curl rust zstd
# implementation modelled from https://github.com/rust-lang/rustup/blob/master/.github/workflows/ci.yaml
# * NOTE: All steps need to be run in this block, otherwise, we are operating back on the Ubuntu host
run: bash ci/openbsd_build.sh
# Run commands on Ubuntu host
- name: Check artifact on Ubuntu runner
run: |
sudo apt-get install -y file
echo "# pwd"
pwd
echo "# ls -l cargo-nextest-build/target/release/cargo-nextest"
ls -l cargo-nextest-build/target/release/cargo-nextest
echo "# Check cargo-nextest file"
file cargo-nextest-build/target/release/cargo-nextest
- name: Upload artifact from build job
uses: actions/upload-artifact@v4
with:
name: cargo-nextest-${{ env.NEXTEST_VERSION }}-openbsd
# Wildcard used to flatten directory hierarchy
path: cargo-nextest-build/target/release/*-nextest
if-no-files-found: error
retention-days: 0
# Job to publish release
publish:
name: Publish release for cargo-nextest
needs: build
runs-on: ubuntu-latest
steps:
# Set NEXTEST_VERSION in env
- name: Set NEXT_VERSION env
run: echo "NEXTEST_VERSION=${{ github.ref_name }}" >> $GITHUB_ENV
- name: Download artifact from build job
uses: actions/download-artifact@v4
with:
name: cargo-nextest-${{ env.NEXTEST_VERSION }}-openbsd
- name: Check artifact on Ubuntu runner
run: |
sudo apt-get install -y file
echo "# pwd"
pwd
echo "# ls -l cargo-nextest"
ls -l cargo-nextest
echo "# Check cargo-nextest file"
file cargo-nextest
- name: Create archive for release
run: |
chmod +x cargo-nextest
tar cvzf cargo-nextest-${{ env.NEXTEST_VERSION }}-openbsd.tar.gz cargo-nextest
# Publish new release
- name: Publish release
uses: softprops/action-gh-release@v2
with:
name: cargo-nextest-openbsd ${{ env.NEXTEST_VERSION }}
body: "Release for cargo-nextest ${{ env.NEXTEST_VERSION }} - See https://github.com/nextest-rs/nextest/releases/tag/cargo-nextest-${{ env.NEXTEST_VERSION }}"
# draft: true
fail_on_unmatched_files: true
files: cargo-nextest-${{ env.NEXTEST_VERSION }}-openbsd.tar.gz