Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "release new crate version" workflow #1172

Merged
merged 1 commit into from
May 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/release-crate-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Release new crate versions
on:
workflow_dispatch:
inputs:
version:
description: 'Crate version'
required: true
default: "0.8.COOL"

permissions: read-all

jobs:
release:
runs-on: ubuntu-latest
name: Release new crate versions
steps:
- name: Checkout code
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
ref: main
persist-credentials: false
- name: Overwrite Cargo.toml files
run: |
set -e

sed -i -e 's/^zerocopy-derive = { version = "=[0-9a-zA-Z\.-]*"/zerocopy-derive = { version = "=${{ github.event.inputs.version }}"/' Cargo.toml
sed -i -e 's/^version = "[0-9a-zA-Z\.-]*"/version = "${{ github.event.inputs.version }}"/' Cargo.toml zerocopy-derive/Cargo.toml

- name: Submit PR
uses: peter-evans/create-pull-request@6d6857d36972b65feb161a90e484f2984215f83e # v6.0.5
with:
commit-message: "Release ${{ github.event.inputs.version }}"
author: Google PR Creation Bot <[email protected]>
committer: Google PR Creation Bot <[email protected]>
title: "Release ${{ github.event.inputs.version }}"
branch: release-${{ github.event.inputs.version }}
push-to-fork: google-pr-creation-bot/zerocopy
token: ${{ secrets.GOOGLE_PR_CREATION_BOT_TOKEN }}
Loading