Bump crate version to 0.18.0 #23
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create GitHub release and publish crate to crates.io | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Get release version from tag | |
id: get_tag_version | |
run: echo ::set-output name=version::${GITHUB_REF#refs/tags/v} | |
- name: Get crate version from Cargo.toml | |
id: get_crate_version | |
run: echo ::set-output name=version::$(cargo read-manifest | jq -r .version) | |
- name: Assert tag version matches crate version | |
run: echo ${{ steps.get_tag_version.outputs.version }} != ${{ steps.get_crate_version.outputs.version }} && exit 1 | |
if: ${{ steps.get_tag_version.outputs.version != steps.get_crate_version.outputs.version }} | |
- name: Create GitHub release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: hcloud-rust v${{ steps.get_tag_version.outputs.version }} | |
draft: true | |
- name: Publish crate to crates.io | |
uses: actions-rs/cargo@v1 | |
with: | |
command: publish | |
args: --token ${{ secrets.CARGO_REGISTRY_TOKEN }} |