Skip to content

Commit

Permalink
Workflow maintenance
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertoPrevato committed Feb 1, 2024
1 parent 1bda7c7 commit 1cd0989
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: Build

on:
workflow_dispatch:
inputs:
publish_artifacts:
description: 'Publish artifacts (Y|N)'
required: true
default: 'N'

This comment has been minimized.

Copy link
@Andre601

Andre601 Feb 2, 2024

I suggest adding

optioms:
  - Y
  - N

Allows you to select an option, rather thantyping it out, tho, default may not work anymore, so the order is probably important here (meaning N would need to come first)

release:
types: [published]
push:
Expand Down Expand Up @@ -40,9 +46,9 @@ jobs:
if: matrix.python-version == '3.10'

- name: Publish CSS files
uses: actions/upload-artifact@master
uses: actions/upload-artifact@v4
with:
name: dist-package-css
name: arts-package-css
path: styles/dist
if: matrix.python-version == '3.10'

Expand Down Expand Up @@ -104,21 +110,22 @@ jobs:
if: matrix.python-version == '3.11'

- name: Upload distribution package
uses: actions/upload-artifact@master
uses: actions/upload-artifact@v4
with:
name: dist
name: dist-${{ matrix.os }}-${{ matrix.python-version }}
path: dist
if: matrix.python-version == '3.11'

publish:
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'release'
if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event.inputs.publish_artifacts == 'Y')
steps:
- name: Download the distribution package
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: dist
pattern: dist-*
merge-multiple: true
path: dist

- name: Use Python 3.11
Expand All @@ -145,18 +152,20 @@ jobs:
TWINE_PASSWORD: ${{ secrets.pypi_password }}

- name: Download CSS pack
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
if: github.event_name == 'release'
with:
name: dist-package-css
path: dist-css
name: arts-package-css
path: arts-css

- name: Add CSS package to the release
uses: actions/[email protected]
if: github.event_name == 'release'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./dist-css/neoteroi-mkdocs.css
asset_path: ./arts-css/neoteroi-mkdocs.css
asset_name: css-${{ github.event.release.tag_name }}.css
asset_content_type: text/css
continue-on-error: true

0 comments on commit 1cd0989

Please sign in to comment.