You can not select more than 25 topics
Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- name: Release
-
- permissions:
- contents: write
-
- on:
- release:
- types:
- - "published"
-
- jobs:
- release:
- name: "Release"
-
- strategy:
- matrix:
- platform: [ubuntu-20.04, macos-12, windows-2022]
- python-version: ["3.7"]
- fail-fast: false
- runs-on: ${{ matrix.platform }}
-
- steps:
- - uses: actions/checkout@v3
-
- - uses: r7kamura/rust-problem-matchers@v1.1.0
-
- - name: "Build binaries"
- timeout-minutes: 60
- run: "cargo build --release -p dora-runtime
- -p dora-coordinator -p dora-cli -p dora-daemon"
-
- - name: "Publish packages on `crates.io`"
- if: runner.os == 'Linux'
- run: |
- # Publish libraries crates
- cargo publish -p dora-message --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
- cargo publish -p dora-tracing --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
- cargo publish -p dora-metrics --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
- cargo publish -p dora-download --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
- cargo publish -p dora-core --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
- cargo publish -p communication-layer-pub-sub --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
- cargo publish -p communication-layer-request-reply --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
-
- # Publish binaries crates
- cargo publish -p dora-cli --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
- cargo publish -p dora-coordinator --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
-
- # Publish rust API
- cargo publish -p dora-operator-api-macros --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
-
- - name: "Create Archive (Unix)"
- if: runner.os == 'Linux' || runner.os == 'macOS'
- run: |
- mkdir archive
- cp target/release/dora-runtime archive
- cp target/release/dora-coordinator archive
- cp target/release/dora-daemon archive
- cp target/release/dora-cli archive/dora
- cd archive
- zip -r ../archive.zip .
- cd ..
-
- - name: Create Archive (Windows)
- if: runner.os == 'Windows'
- shell: powershell
- run: |
- New-Item -Path archive -ItemType Directory
- Copy-Item target/release/dora-runtime.exe -Destination archive
- Copy-Item target/release/dora-coordinator.exe -Destination archive
- Copy-Item target/release/dora-daemon.exe -Destination archive
- Copy-Item target/release/dora-cli.exe -Destination archive/dora.exe
- Compress-Archive -Path archive\* -DestinationPath archive.zip
-
- - name: "Upload release asset"
- uses: actions/upload-release-asset@v1.0.1
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- with:
- upload_url: ${{ github.event.release.upload_url }}
- asset_path: archive.zip
- asset_name: dora-${{ github.ref_name }}-x86_64-${{ runner.os }}.zip
- asset_content_type: application/zip
|