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
# name: Publish to Cargo
# on:
# push:
# branches: [ main ]
# jobs:
# publish:
# runs-on: ubuntu-latest
# name: 'publish'
# # Reference your environment variables
# environment: cargo
# steps:
# - uses: actions/checkout@master
# # Use caching to speed up your build
# - name: Cache publish-action bin
# id: cache-publish-action
# uses: actions/cache@v3
# env:
# cache-name: cache-publish-action
# with:
# path: ~/.cargo
# key: ${{ runner.os }}-build-${{ env.cache-name }}-v0.2.0
# # install publish-action by cargo in github action
# - name: Install publish-action
# if: steps.cache-publish-action.outputs.cache-hit != 'true'
# run:
# cargo install publish-action --version=0.2.0
# - name: Run publish-action
# id: publish-action
# run:
# publish-action
# env:
# # This can help you tagging the github repository
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# # This can help you publish to crates.io
# CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}