From b44889cd7a9846a40a5410c816739d913d0a3d73 Mon Sep 17 00:00:00 2001 From: Uwe Klotz Date: Sun, 23 Jul 2023 17:44:58 +0200 Subject: [PATCH] GitHub CI: Add action for publishing tagged releases on crates.io --- .github/workflows/publish-release.yaml | 28 ++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/publish-release.yaml diff --git a/.github/workflows/publish-release.yaml b/.github/workflows/publish-release.yaml new file mode 100644 index 00000000..08b6184a --- /dev/null +++ b/.github/workflows/publish-release.yaml @@ -0,0 +1,28 @@ +# SPDX-FileCopyrightText: Copyright (c) 2017-2023 slowtec GmbH +# 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}