forked from async-graphql/async-graphql
-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (74 loc) · 2.57 KB
/
release.yml
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
name: Release
on:
push:
branches:
- release
paths:
- "**/Cargo.toml"
- ".github/workflows/release.yml"
jobs:
publish:
runs-on: ubuntu-20.04
strategy:
fail-fast: false
max-parallel: 1
matrix:
package:
- name: async-graphql-value
registryName: async-graphql-value
path: value
- name: async-graphql-parser
registryName: async-graphql-parser
path: parser
- name: async-graphql-derive
registryName: async-graphql-derive
path: derive
- name: async-graphql
registryName: async-graphql
path: .
- name: async-graphql-actix-web
registryName: async-graphql-actix-web
path: integrations/actix-web
- name: async-graphql-warp
registryName: async-graphql-warp
path: integrations/warp
- name: async-graphql-poem
registryName: async-graphql-poem
path: integrations/poem
- name: async-graphql-axum
registryName: async-graphql-axum
path: integrations/axum
- name: async-graphql-rocket
registryName: async-graphql-rocket
path: integrations/rocket
- name: async-graphql-tide
registryName: async-graphql-tide
path: integrations/tide
steps:
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Checkout
uses: actions/checkout@v2
- name: get version
working-directory: ${{ matrix.package.path }}
run: echo PACKAGE_VERSION=$(sed -nE 's/^\s*version = "(.*?)"/\1/p' Cargo.toml) >> $GITHUB_ENV
- name: check published version
run: echo PUBLISHED_VERSION=$(cargo search ${{ matrix.package.registryName }} --limit 1 | sed -nE 's/^[^"]*"//; s/".*//1p' -) >> $GITHUB_ENV
- name: cargo login
if: env.PACKAGE_VERSION != env.PUBLISHED_VERSION
run: cargo login ${{ secrets.CRATES_TOKEN }}
- name: cargo package
if: env.PACKAGE_VERSION != env.PUBLISHED_VERSION
working-directory: ${{ matrix.package.path }}
run: |
cargo package
echo "We will publish:" $PACKAGE_VERSION
echo "This is current latest:" $PUBLISHED_VERSION
- name: Publish ${{ matrix.package.name }}
if: env.PACKAGE_VERSION != env.PUBLISHED_VERSION
working-directory: ${{ matrix.package.path }}
run: |
echo "# Cargo Publish"
cargo publish --no-verify