Skip to content

Add support for --no-use-platform-suffix. (#96) #23

Add support for --no-use-platform-suffix. (#96)

Add support for --no-use-platform-suffix. (#96) #23

Workflow file for this run

name: Release
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+
workflow_dispatch:
inputs:
tag:
description: The tag to manually run a deploy for.
required: true
jobs:
org-check:
name: Check GitHub Organization
if: ${{ github.repository_owner == 'a-scie' }}
runs-on: ubuntu-22.04
steps:
- name: Noop
run: "true"
determine-tag:
name: Determine the release tag to operate against.
needs: org-check
runs-on: ubuntu-22.04
outputs:
release-tag: ${{ steps.determine-tag.outputs.release-tag }}
release-version: ${{ steps.determine-tag.outputs.release-version }}
steps:
- name: Determine Tag
id: determine-tag
run: |
if [[ -n "${{ github.event.inputs.tag }}" ]]; then
RELEASE_TAG=${{ github.event.inputs.tag }}
else
RELEASE_TAG=${GITHUB_REF#refs/tags/}
fi
if [[ "${RELEASE_TAG}" =~ ^v[0-9]+.[0-9]+.[0-9]+$ ]]; then
echo "release-tag=${RELEASE_TAG}" >> $GITHUB_OUTPUT
echo "release-version=${RELEASE_TAG#v}" >> $GITHUB_OUTPUT
else
echo "::error::Release tag '${RELEASE_TAG}' must match 'v\d+.\d+.\d+'."
exit 1
fi
github-release:
name: (${{ matrix.os }}) Create Github Release
needs: determine-tag
runs-on: ${{ matrix.os }}
strategy:
matrix:
# N.B.: macos-12 is the oldest non-deprecated Intel Mac runner and macos-14 is the oldest
# non-deprecated ARM Mac runner.
os: [ ubuntu-22.04, linux-arm64, macos-12, macos-14, windows-2022, windows-arm64 ]
environment: Release
env:
SCIENCE_AUTH_API_GITHUB_COM_BEARER: ${{ secrets.GITHUB_TOKEN }}
permissions:
id-token: write
attestations: write
contents: write
discussions: write
steps:
- name: Setup Python 3.12
if: matrix.os != 'linux-arm64' && matrix.os != 'windows-arm64'
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Setup Python 3.12
if: matrix.os == 'linux-arm64'
run: |
python3.12 -m venv .venv
echo "$(pwd)/.venv/bin" >> "${GITHUB_PATH}"
- name: Setup Python 3.12
if: matrix.os == 'windows-arm64'
run: |
py -3.12 -m venv .venv
echo "$(pwd)/.venv/Scripts" >> "${GITHUB_PATH}"
- name: Setup Nox
run: pip install nox
- name: Checkout lift ${{ needs.determine-tag.outputs.release-tag }}
uses: actions/checkout@v4
with:
ref: ${{ needs.determine-tag.outputs.release-tag }}
- name: Package science ${{ needs.determine-tag.outputs.release-tag }} binary
run: nox -e package
- name: Generate science ${{ needs.determine-tag.outputs.release-tag }} artifact attestations
uses: actions/attest-build-provenance@v1
with:
subject-path: dist/science-*
- name: Prepare Changelog
id: prepare-changelog
uses: a-scie/actions/changelog@v1.6
with:
changelog-file: ${{ github.workspace }}/CHANGES.md
version: ${{ needs.determine-tag.outputs.release-version }}
setup-python: ${{ matrix.os != 'linux-arm64' && matrix.os != 'windows-arm64' }}
- name: Create ${{ needs.determine-tag.outputs.release-tag }} Release
if: matrix.os == 'ubuntu-22.04'
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.determine-tag.outputs.release-tag }}
name: science ${{ needs.determine-tag.outputs.release-version }}
body_path: ${{ steps.prepare-changelog.outputs.changelog-file }}
draft: false
prerelease: false
files: dist/science-*
fail_on_unmatched_files: true
discussion_category_name: Announcements
- name: Add Binaries to ${{ needs.determine-tag.outputs.release-tag }} Release
if: matrix.os != 'ubuntu-22.04'
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.determine-tag.outputs.release-tag }}
files: dist/science-*
fail_on_unmatched_files: true