diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..b005f97 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,59 @@ +name: Build Addon + +on: + push: + tags: + - 'v*.*.*' + + pull_request: + branches: [main] + + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up PDM + uses: pdm-project/setup-pdm@v4 + with: + python-version: '3.11' + + - name: Install dependencies + run: | + pdm sync -d -G build + + - name: Build addon + run: pdm run compile + + - name: Upload build artifacts + if: success() + uses: actions/upload-artifact@v4 + with: + name: packaged_addon + path: bin/simple-recorder.pyz + + upload_release: + runs-on: ubuntu-latest + if: ${{ startsWith(github.ref, 'refs/tags/') }} + needs: build + + steps: + - name: Download releases files + uses: actions/download-artifact@v4.1.7 + with: + name: packaged_addon + + - name: Display structure of downloaded files + run: tree + + - name: Release + uses: softprops/action-gh-release@v1 + with: + files: bin/simple-recorder.pyz + fail_on_unmatched_files: true + prerelease: ${{ contains(github.ref, '-') }}