diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..f6e8141 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,46 @@ +name: Build and Upload Release Asset + +on: + push: + tags: + - 'v*.*.*' + +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' + + - 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: jawroski-napari-plugin-dist.zip + release_id: ${{ steps.create_release.outputs.id }} + asset_path: dist/* + asset_content_type: application/zip \ No newline at end of file