Publish packages #73
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish packages | |
on: | |
workflow_dispatch: | |
inputs: | |
release_tag: | |
description: 'Release tag' | |
required: true | |
docker_tag: | |
description: 'Docker image tag' | |
required: true | |
jobs: | |
push-to-registry: | |
name: Push docker image to GCR | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v2 | |
- name: Push to GitHub Container Registry | |
uses: docker/build-push-action@v1 | |
with: | |
username: ${{ github.actor }} | |
password: ${{ secrets.CR_PAT }} | |
registry: ghcr.io | |
repository: reinterpretcat/vrp/vrp-cli | |
tags: ${{ github.event.inputs.docker_tag }} | |
push-to-crates: | |
name: Push crates to crates.io | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v2 | |
- name: Publish all packages from workspace | |
run: | | |
cargo login ${{ secrets.CRATES_IO_TOKEN }} | |
cd rosomaxa && cargo publish && sleep 20 | |
cd ../vrp-core && cargo publish && sleep 20 | |
cd ../vrp-scientific && cargo publish && sleep 20 | |
cd ../vrp-pragmatic && cargo publish && sleep 20 | |
cd ../vrp-cli && cargo publish | |
push-release: | |
name: Push release on github | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out the repo | |
uses: actions/checkout@v2 | |
- name: Build WebAssembly artefact | |
run: | | |
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh | |
cd vrp-cli | |
wasm-pack build --target web | |
- name: Archive artifacts | |
uses: montudor/action-zip@v0.1.0 | |
with: | |
args: zip -qq -r vrp_cli_wasm.zip vrp-cli/pkg | |
- name: Create tag and release on github repo | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.event.inputs.release_tag }} | |
release_name: ${{ github.event.inputs.release_tag }} | |
draft: false | |
prerelease: false | |
- name: Upload release asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./vrp_cli_wasm.zip | |
asset_name: vrp_cli_wasm.zip | |
asset_content_type: application/zip |