Skip to content

ci: minor fixes

ci: minor fixes #3

Workflow file for this run

name: Release
env:
py: "3.11"
on:
push:
tags:
- 'v*.*.*'
defaults:
run:
shell: bash -l {0}
permissions:
contents: write
jobs:
# Test:
# strategy:
# fail-fast: false
# matrix:
# os: [ubuntu-latest]
# python-version: [ "3.9", "3.10", "3.11" ]
# include:
# - os: ubuntu-latest
# # - os: windows-latest
# # - os: macos-latest
# runs-on: ${{ matrix.os }}
# steps:
# - name: 🧾 Checkout repository
# uses: actions/checkout@v4
# - name: 🛠️ Install Python ${{ matrix.python-version }} and deps with micromamba
# uses: mamba-org/setup-micromamba@v1
# with:
# environment-file: metator.yaml
# init-shell: bash
# cache-environment: false
# post-cleanup: 'none'
# generate-run-shell: true
# create-args: >-
# python=${{ matrix.python-version }}
# - name: 📦 Install package
# run: |
# pip install .[test]
# shell: micromamba-shell {0}
# - name: 🧪 Run tests with Python ${{ matrix.python-version }}
# run: |
# ruff check . --select=E9,F63,F7,F82
# pytest --cov --cov-report=xml
# codecov
# shell: micromamba-shell {0}
Release:
# needs: Test
runs-on: ubuntu-latest
steps:
- name: 🧾 Checkout repository
uses: actions/checkout@v4
- name: 🔍 Check version
run: |
tag_version=${GITHUB_REF#refs/tags/v}
pkg_version=$(grep -Po '(?<=^version = ")[^"]*' pyproject.toml)
if [ "$tag_version" != "$pkg_version" ]; then
echo "Version mismatch: tag version ($tag_version) does not match pyproject.toml version ($pkg_version)"
exit 1
else
echo "Version match: tag version ($tag_version) matches pyproject.toml version ($pkg_version)"
fi
- name: 🧳 Create zip archive
run: zip -r ../metator-${{ github.ref_name }}.zip .
- name: 🧳 Create tar.gz archive
run: tar -czvf ../metator-${{ github.ref_name }}.tar.gz .
- name: 📦 Create GitHub release
uses: softprops/action-gh-release@v2
with:
files: |
../metator-${{ github.ref_name }}.zip
../metator-${{ github.ref_name }}.tar.gz