Skip to content

Release Rust Binary #39

Release Rust Binary

Release Rust Binary #39

name: Release Rust Binary
on:
workflow_run:
workflows: ["Rust Binary"]
types:
- completed
branches: [main]
jobs:
release:
name: Release
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
github-token: ${{secrets.GITHUB_TOKEN}}
run-id: ${{github.event.workflow_run.id}}
- name: Check for artifacts
id: check_artifacts
run: |
if [ -z "$(find . -name 'deno-webview*')" ]; then
echo "No artifacts found. Exiting successfully."
echo "artifacts_found=false" >> $GITHUB_OUTPUT
else
echo "Artifacts found. Proceeding with release."
echo "artifacts_found=true" >> $GITHUB_OUTPUT
fi
- name: Get version from Cargo.toml
if: steps.check_artifacts.outputs.artifacts_found == 'true'
id: get_version
run: |
VERSION=$(grep '^version =' Cargo.toml | sed 's/.*= *"//' | sed 's/".*//')
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Create Release
if: steps.check_artifacts.outputs.artifacts_found == 'true'
uses: ncipollo/release-action@v1
with:
tag: webview-v${{ steps.get_version.outputs.version }}
name: Release ${{ steps.get_version.outputs.version }}
token: ${{ secrets.GITHUB_TOKEN }}
prerelease: true
skipIfReleaseExists: true
artifacts: "release-binary-*/deno-webview*"
artifactErrorsFailBuild: true