-
Notifications
You must be signed in to change notification settings - Fork 74
83 lines (73 loc) · 2.41 KB
/
publish.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
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