-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (51 loc) · 1.5 KB
/
release.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
on:
release:
types: [published]
name: Release
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: The tag name and the package version should match.
run: |
CARGO_PACKAGE_VERSION=`cargo metadata --no-deps | jq -r '.packages[0].version'`
test ${TAG_NAME} = ${CARGO_PACKAGE_VERSION}
env:
TAG_NAME: ${{ github.event.release.tag_name }}
push-dockerhub:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: davidB/rust-cargo-make@v1
- run: cargo make push-repository
env:
IMAGE_REPOSITORY: ${{ secrets.IMAGE_REPOSITORY }}
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
release-binary:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: davidB/rust-cargo-make@v1
- uses: Swatinem/rust-cache@v1
- run: cargo make build-release
- run: cargo make compress-binary
- uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: '*.zip'
tag: ${{ github.ref }}
overwrite: true
file_glob: true