ci: Set up an autorelease pipeline

This commit adds a pipeline that automatically creates a GitHub Release
and a crates.io release when a tag is pushed.

Signed-off-by: John Nunley <dev@notgull.net>
This commit is contained in:
John Nunley 2024-01-28 12:51:01 -08:00 committed by GitHub
parent 34d52bd350
commit e435fc99bc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

24
.github/workflows/release.yml vendored Normal file
View file

@ -0,0 +1,24 @@
name: Release
permissions:
contents: write
on:
push:
tags:
- v[0-9]+.*
jobs:
create-release:
if: github.repository_owner == 'rust-windowing'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: taiki-e/create-gh-release-action@v1
with:
changelog: CHANGELOG.md
branch: master
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
- name: Publish to crates.io
run: cargo publish --token ${{ secrets.CRATES_IO_API_TOKEN }}