From d737437e4c53a7687795b33173e1141dc7c6081c Mon Sep 17 00:00:00 2001 From: Camilo Diaz Date: Fri, 8 Nov 2024 11:24:43 -0500 Subject: [PATCH 1/2] maint: add publish github-action workflow --- .github/workflows/publish.yml | 46 +++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..059f0c4 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,46 @@ +name: Build and Upload Release Asset + +on: + push: + tags: + - 'v*.*.*' # Trigger on version tags like v1.0.0 + +jobs: + build-and-upload: + runs-on: ubuntu-latest + + steps: + - name: Check out the repository + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.9' # Adjust based on your project's requirements + + - name: Install `uv` + run: | + python -m pip install --upgrade pip + pip install astral-sh[uv] # Install `uv` for building + + - name: Build the package with `uv` + run: uv build + + - name: Create GitHub Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref_name }} + release_name: Release ${{ github.ref_name }} + draft: false + prerelease: false + + - name: Upload Release Asset + uses: actions/upload-release-asset@v1 + with: + name: napari-plugin-dist.zip # Name of the asset file as it appears in the release + release_id: ${{ steps.create_release.outputs.id }} + asset_path: dist/* # Path to the build output + asset_content_type: application/zip \ No newline at end of file From d33fec0635d1c5d4e0cb692846011087340c5538 Mon Sep 17 00:00:00 2001 From: Camilo Diaz Date: Fri, 8 Nov 2024 11:26:18 -0500 Subject: [PATCH 2/2] maint: fixing release name --- .github/workflows/publish.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 059f0c4..f6e8141 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -3,7 +3,7 @@ name: Build and Upload Release Asset on: push: tags: - - 'v*.*.*' # Trigger on version tags like v1.0.0 + - 'v*.*.*' jobs: build-and-upload: @@ -16,7 +16,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v5 with: - python-version: '3.9' # Adjust based on your project's requirements + python-version: '3.9' - name: Install `uv` run: | @@ -40,7 +40,7 @@ jobs: - name: Upload Release Asset uses: actions/upload-release-asset@v1 with: - name: napari-plugin-dist.zip # Name of the asset file as it appears in the release + name: jawroski-napari-plugin-dist.zip release_id: ${{ steps.create_release.outputs.id }} - asset_path: dist/* # Path to the build output + asset_path: dist/* asset_content_type: application/zip \ No newline at end of file