name: release
on:
push:
tags:
- "*.*.*"
jobs:
publish:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
./target
key: ${{ runner.os }}-redsync-${{ hashFiles('Cargo.toml') }}
restore-keys: ${{ runner.os }}-redsync-
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
with:
command: publish
args: --token ${{ secrets.CRATESIO_TOKEN }}
- name: Get tag
id: tag
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.tag.outputs.VERSION }}
release_name: v${{ steps.tag.outputs.VERSION }}
body: |
Add the following line to your Cargo.toml file:
```toml
redsync = "${{ steps.tag.outputs.VERSION }}"
```