diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9942a6fba..5a118b2fd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -122,6 +122,23 @@ jobs: run: | cmake --build build --target test + - name: Make release_artifacts folder + run: mkdir release_artifacts + + - name: Add prefix to python_wheel artifact + run: | + for file in ./build/pypangolin-*.whl; do + mv $file ./release_artifacts/${{matrix.os}}_shared_libs_${{matrix.shared_libs}}.$(basename $file); + done + + - name: 'Upload release_artifacts' + uses: actions/upload-artifact@v4 + with: + name: "release_artifacts_${{matrix.os}}_${{matrix.shared_libs}}" + path: release_artifacts/* + retention-days: 2 + + emscripten: runs-on: ubuntu-22.04 @@ -158,4 +175,26 @@ jobs: # build_dir path relative to ${{runner.workspace}}/Pangolin build_dir: ../www env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }} + + release: + needs: build + if: contains(needs.*.result, 'success') && contains(github.ref, '/tags/v') + runs-on: ubuntu-22.04 + + steps: + - name: Download artifacts + uses: actions/download-artifact@v4 + with: + pattern: release_artifacts_* + path: ./release_artifacts + merge-multiple: true + + - name: Upload release + uses: softprops/action-gh-release@v2 + with: + name: ${{ github.ref_name }} + tag_name: ${{ github.ref_name }} + files: release_artifacts/* + token: ${{ secrets.REPO_TOKEN }} + generate_release_notes: true