Skip to content

Commit

Permalink
Added release action (#32)
Browse files Browse the repository at this point in the history
* Added a release action.

* Updated workflows.
  • Loading branch information
wanmok authored Oct 28, 2024
1 parent ffb592d commit 443e318
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 30 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Clean site
run: |
rm -rf ./site
mkdir ./site
- name: Download Artifact Docs
id: download
uses: dawidd6/action-download-artifact@v2.27.0
uses: dawidd6/action-download-artifact@v6
with:
if_no_artifact_found: ignore
github_token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -47,12 +47,12 @@ jobs:
name: docs-site
path: ./site/
- name: Setup Pages
uses: actions/configure-pages@v3
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: './site/'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
uses: actions/deploy-pages@v4
11 changes: 6 additions & 5 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,15 @@ jobs:
uses: jakebailey/pyright-action@v2
with:
version: 1.1.386
- name: Doc Cache
uses: actions/cache@v4
with:
key: mkdocs-cards-${{ github.ref }}-v1
path: .cache
- name: Build Docs
run: uv run mkdocs build
- name: Build package
run: uv build
- uses: actions/upload-artifact@v4
with:
name: docs-site
path: ./site/**
- uses: actions/upload-artifact@v4
with:
name: build
path: ./dist/**
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Upload Python Package

on:
release:
types: [published]

permissions:
contents: read

jobs:
deploy:
environment: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
# Install a specific version of uv.
version: "0.4.27"
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Clean build
run: |
rm -rf ./dist
mkdir ./dist
- name: Download Artifact build
id: download
uses: dawidd6/action-download-artifact@v6
with:
if_no_artifact_found: ignore
github_token: ${{ secrets.GITHUB_TOKEN }}
workflow: python-app.yml
run_id: ${{ github.event.workflow_run.id }}
name: build
path: ./dist/
- name: Publish package
run: uv publish
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,4 @@ cython_debug/
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
.idea/
19 changes: 0 additions & 19 deletions .idea/metametric.iml

This file was deleted.

0 comments on commit 443e318

Please sign in to comment.