Skip to content

Commit

Permalink
GitHub CI: Add action for publishing tagged releases on crates.io
Browse files Browse the repository at this point in the history
  • Loading branch information
uklotzde authored and flosse committed Jul 25, 2023
1 parent 8a7a10d commit b44889c
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/publish-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# SPDX-FileCopyrightText: Copyright (c) 2017-2023 slowtec GmbH <post@slowtec.de>
# SPDX-License-Identifier: CC0-1.0

# yaml-language-server: $schema=https://json.schemastore.org/github-workflow

name: publish-release

permissions:
contents: read

on:
push:
tags:
# Only match release version tags
- "v[0-9]+.[0-9]+.[0-9]+"

jobs:
cargo-publish:
runs-on: ubuntu-latest
steps:
- uses: dtolnay/rust-toolchain@stable

- uses: actions/checkout@v3

- name: Publish release on crates.io
env:
API_TOKEN: ${{ secrets.CRATES_IO_PUBLISH_UPDATE_TOKEN }}
run: cargo publish --token ${API_TOKEN}

0 comments on commit b44889c

Please sign in to comment.