Skip to content

Publish GitHub Release #101

Publish GitHub Release

Publish GitHub Release #101

# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# Creates a GitHub release for a crate when a version tag (e.g. "bytesbuf-v1.2.3")
# is pushed. Extracts the relevant changelog section and publishes the release via
# `scripts/publish-gh-release.rs`. This workflow is triggered automatically by tag
# pushes and is not intended to be run manually.
name: Publish GitHub Release
permissions:
contents: write
on:
push:
tags:
- '*-v[0-9]+.[0-9]+.[0-9]+'
workflow_dispatch:
inputs:
tag:
description: 'The tag to create a release for (e.g. "oxidizer-v1.2.3")'
required: true
jobs:
create-release:
runs-on: ubuntu-slim
steps:
- name: Checkout
uses: actions/checkout@v7.0.0
- name: Setup
uses: ./.github/actions/setup
with:
rust-toolchain: RUST_NIGHTLY
- name: Create GitHub Release
env:
GH_TOKEN: ${{ github.token }}
run: cargo +${{ env.RUST_NIGHTLY }} -Zscript scripts/publish-gh-release.rs --repo "${{ github.repository }}" "${{ inputs.tag || github.ref_name }}"