name: Release artifacts on: release: types: [ published ] jobs: push_server_to_docker_registry: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 with: submodules: true - uses: docker/setup-buildx-action@v1 - uses: docker/metadata-action@v3 id: docker_meta with: images: | ${{ github.repository }} ghcr.io/${{ github.repository }} - uses: docker/login-action@v1 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - uses: docker/login-action@v1 with: registry: ghcr.io username: ${{github.actor}} password: ${{secrets.GITHUB_TOKEN}} - uses: docker/build-push-action@v2 with: context: . file: server/Dockerfile pull: true push: true tags: ${{ steps.docker_meta.outputs.tags }} labels: ${{ steps.docker_meta.outputs.labels }} cache-from: type=gha cache-to: type=gha,mode=max publish_crates: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 with: submodules: true - run: rustup update - run: cargo login $CRATES_IO_TOKEN env: CRATES_IO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }} - run: cargo publish working-directory: ./oxrocksdb-sys - run: cargo publish working-directory: ./lib/oxrdf - run: sleep 60 - run: cargo publish working-directory: ./lib/sparesults - run: cargo publish working-directory: ./lib/spargebra - run: sleep 60 - run: cargo publish working-directory: ./lib - run: sleep 60 - run: cargo publish working-directory: ./server publish_pypi_linux: runs-on: ubuntu-latest strategy: matrix: architecture: [ "x86_64", "aarch64" ] steps: - uses: actions/checkout@v2 with: submodules: true - uses: docker/setup-qemu-action@v1 with: platforms: linux/${{ matrix.architecture }} if: matrix.architecture != 'x86_64' - run: sed 's/%arch%/${{ matrix.architecture }}/g' .github/workflows/manylinux_build.sh > .github/workflows/manylinux_build_script.sh - run: docker run -v "$(pwd)":/workdir --platform linux/${{ matrix.architecture }} quay.io/pypa/manylinux2014_${{ matrix.architecture }} /bin/bash /workdir/.github/workflows/manylinux_build_script.sh - uses: pypa/gh-action-pypi-publish@release/v1 with: user: __token__ password: ${{ secrets.PYPI_PASSWORD }} packages_dir: target/wheels - uses: softprops/action-gh-release@v1 with: files: target/wheels/* publish_pypi_mac: runs-on: macos-latest env: DEVELOPER_DIR: '/Applications/Xcode.app/Contents/Developer' SDKROOT: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk' MACOSX_DEPLOYMENT_TARGET: '10.14' steps: - uses: actions/checkout@v2 with: submodules: true - uses: actions/setup-python@v2 with: python-version: 3.7 - run: rustup update && rustup target add aarch64-apple-darwin - run: pip install maturin - run: maturin publish --no-sdist --universal2 -m python/Cargo.toml -u __token__ -p ${{ secrets.PYPI_PASSWORD }} - run: maturin publish --no-sdist -m python/Cargo.toml -u __token__ -p ${{ secrets.PYPI_PASSWORD }} - uses: softprops/action-gh-release@v1 with: files: target/wheels/* publish_pypi_windows: runs-on: windows-latest steps: - uses: actions/checkout@v2 with: submodules: true - uses: actions/setup-python@v2 with: python-version: 3.7 - run: rustup update - run: pip install maturin - run: Remove-Item -LiteralPath "C:\msys64\" -Force -Recurse - run: maturin publish --no-sdist -m python/Cargo.toml -u __token__ -p ${{ secrets.PYPI_PASSWORD }} - uses: softprops/action-gh-release@v1 with: files: target/wheels/* publish_pypi_stdist: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 with: submodules: true - run: pip install maturin - run: maturin sdist -m python/Cargo.toml - uses: pypa/gh-action-pypi-publish@release/v1 with: user: __token__ password: ${{ secrets.PYPI_PASSWORD }} packages_dir: target/wheels - uses: softprops/action-gh-release@v1 with: files: target/wheels/* publish_npm: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 with: submodules: true - uses: actions/setup-node@v2 with: node-version: 14 registry-url: https://registry.npmjs.org - run: rustup update - run: cargo install wasm-pack - run: npm install working-directory: ./js - run: npm run release working-directory: ./js env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: npm run pack working-directory: ./js - uses: softprops/action-gh-release@v1 with: files: js/*.tgz publish_python_doc: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 with: submodules: true - run: rustup update - uses: actions/setup-python@v2 with: python-version: 3.8 - run: python -m venv python/venv - run: source python/venv/bin/activate && pip install --upgrade maturin sphinx - run: source venv/bin/activate && maturin develop working-directory: ./python - run: source ../venv/bin/activate && sphinx-build -M doctest . build working-directory: ./python/docs - run: source ../venv/bin/activate && sphinx-build -M html . build working-directory: ./python/docs - uses: actions/checkout@v2 with: repository: oxigraph/oxigraph.github.io path: website token: ${{ secrets.FULL_ACCESS_TOKEN }} - run: echo "RELEASE_VERSION=$(echo ${GITHUB_REF:10})" >> $GITHUB_ENV - run: rm -rf ./website/pyoxigraph/stable && mkdir -p ./website/pyoxigraph/stable && cp -r ./python/docs/build/html/* ./website/pyoxigraph/stable/ if: "!contains('-', github.event.release.tag_name)" - run: mkdir -p ./website/pyoxigraph/$RELEASE_VERSION && cp -r ./python/docs/build/html/* ./website/pyoxigraph/$RELEASE_VERSION/ - run: | git config user.name github-actions git config user.email github-actions@github.com git add . git diff-index --quiet HEAD || git commit -m "Updates pyoxigraph documentation" git push working-directory: ./website publish_full_archive: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 with: submodules: true - run: | zip -r oxigraph_${{ github.event.release.tag_name }}.zip . tar -czf /tmp/oxigraph_${{ github.event.release.tag_name }}.tar.gz . mv /tmp/oxigraph_${{ github.event.release.tag_name }}.tar.gz . - uses: softprops/action-gh-release@v1 with: files: | oxigraph_${{ github.event.release.tag_name }}.zip oxigraph_${{ github.event.release.tag_name }}.tar.gz publish_homebrew: if: "!contains('-', github.event.release.tag_name)" runs-on: ubuntu-latest needs: publish_full_archive steps: - uses: actions/checkout@v2 with: repository: oxigraph/homebrew-oxigraph token: ${{ secrets.FULL_ACCESS_TOKEN }} - run: | wget "https://github.com/oxigraph/oxigraph/releases/download/${{ github.event.release.tag_name }}/oxigraph_${{ github.event.release.tag_name }}.tar.gz" SHA=`shasum -a 256 "oxigraph_${{ github.event.release.tag_name }}.tar.gz" | awk '{ print $1 }'` rm "oxigraph_${{ github.event.release.tag_name }}.tar.gz" sed -i "s/download\/.*\.tar/download\/${{ github.event.release.tag_name }}\/oxigraph_${{ github.event.release.tag_name }}.tar/g" Formula/oxigraph.rb sed -i "s/sha256 \".*\"/sha256 \"$SHA\"/g" Formula/oxigraph.rb git config user.name github-actions git config user.email github-actions@github.com git add . git diff-index --quiet HEAD || git commit -m "Upgrades to ${{ github.event.release.tag_name }}" git push publish_binary_linux: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 with: submodules: true - run: cargo build --release working-directory: ./server - run: mv target/release/oxigraph_server oxigraph_server_${{ github.event.release.tag_name }}_x86_64_linux_gnu - uses: softprops/action-gh-release@v1 with: files: oxigraph_server_${{ github.event.release.tag_name }}_x86_64_linux_gnu publish_binary_mac: runs-on: macos-latest env: DEVELOPER_DIR: '/Applications/Xcode.app/Contents/Developer' SDKROOT: '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk' MACOSX_DEPLOYMENT_TARGET: '10.14' steps: - uses: actions/checkout@v2 with: submodules: true - run: rustup update - run: cargo build --release working-directory: ./server - run: mv target/release/oxigraph_server oxigraph_server_${{ github.event.release.tag_name }}_x86_64_apple - uses: softprops/action-gh-release@v1 with: files: oxigraph_server_${{ github.event.release.tag_name }}_x86_64_apple publish_binary_windows: runs-on: windows-latest steps: - uses: actions/checkout@v2 with: submodules: true - run: rustup update - run: Remove-Item -LiteralPath "C:\msys64\" -Force -Recurse - run: cargo build --release working-directory: ./server - run: mv target/release/oxigraph_server.exe oxigraph_server_${{ github.event.release.tag_name }}_x86_64_windows_msvc.exe - uses: softprops/action-gh-release@v1 with: files: oxigraph_server_${{ github.event.release.tag_name }}_x86_64_windows_msvc.exe