Skip to content

🚚 deploy~

🚚 deploy~ #72

Workflow file for this run

name: 🚚 deploy~
on:
workflow_dispatch:
inputs:
dry_run:
description: 'Dry run'
type: boolean
default: true
permissions:
contents: write
discussions: write
packages: read
jobs:
pre-flight-checks:
if: "!(contains(github.event.head_commit.message, '[cd skip]') || contains(github.event.head_commit.message, '[skip cd]'))"
runs-on: ubuntu-latest
outputs:
MOMMY_VERSION: ${{ steps.mommy_version.outputs.MOMMY_VERSION }}
steps:
- name: Print inputs
run: |
echo "dry_run: ${{ github.event.inputs.dry_run }}"
- name: Checkout
uses: actions/checkout@v4
- name: Extract mommy's version number
id: mommy_version
run: |
MOMMY_VERSION="v$(head -n 1 ./version)"
echo "MOMMY_VERSION=$MOMMY_VERSION" >> "$GITHUB_ENV"
echo "MOMMY_VERSION=$MOMMY_VERSION" >> "$GITHUB_OUTPUT"
- name: Check if release already exists
# yes, you really do need to compare with a string, and no, using ! does not work~
if: ${{ github.event.inputs.dry_run == 'false' }}
# using `fetch-tags` option of `actions/checkout` does not work properly~
run: |
git fetch --prune --unshallow --tags
! git show-ref --tags "$MOMMY_VERSION" --quiet
build-netbsd:
needs: [ pre-flight-checks ]
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install fpm && Build package
uses: cross-platform-actions/action@v0.22.0
with:
operating_system: netbsd
version: "9.3"
run: |
set -e
export PATH="/usr/sbin:$PATH" # Add 'pkg_*' commands to path
echo "::group::Install basic packages"
sudo pkgin -y in git gmake mozilla-rootcerts-openssl
echo "::endgroup::"
echo "::group::Ignore ownership issues"
git config --global --add safe.directory "$GITHUB_WORKSPACE"
echo "::endgroup::"
echo "::group::Build package"
gmake dist/netbsd
echo "::endgroup::"