Skip to content

Commit

Permalink
👷 ci: add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
SigureMo committed Nov 16, 2023
1 parent 21f2a9a commit a82e91e
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 16 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Release

on:
push:
tags: ["v*"]
workflow_dispatch:

jobs:
release-build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
with:
python-version: "3.x"

- name: Install just
uses: extractions/setup-just@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: build release distributions
run: |
just create-venv
just install
just build
- name: upload dists
uses: actions/upload-artifact@v3
with:
name: release-dists
path: dist/

publish-pypi:
runs-on: ubuntu-latest
name: Publish to PyPI
if: "startsWith(github.ref, 'refs/tags/')"
needs:
- release-build
permissions:
id-token: write

steps:
- name: Retrieve release distributions
uses: actions/download-artifact@v3
with:
name: release-dists
path: dist/

- name: Publish release distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

publish-release:
runs-on: ubuntu-latest
name: Publish to GitHub
if: "startsWith(github.ref, 'refs/tags/')"
needs:
- release-build
permissions:
contents: write
steps:
- uses: actions/download-artifact@v3
with:
name: release-dists
path: dist/
- name: Get tag name
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Publish to GitHub
uses: softprops/action-gh-release@v1
with:
draft: true
files: dist/*
tag_name: ${{ env.RELEASE_VERSION }}
12 changes: 6 additions & 6 deletions .pre-commit-hooks.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
- id: cmakelint
name: CMake Lint
description: This hook lints CMake files for style issues.
entry: cmakelint
language: python
types: [cmake]
- id: cmakelint
name: CMake Lint
description: This hook lints CMake files for style issues.
entry: cmakelint
language: python
types: [cmake]
10 changes: 0 additions & 10 deletions test-requirements

This file was deleted.

0 comments on commit a82e91e

Please sign in to comment.