-
Notifications
You must be signed in to change notification settings - Fork 105
49 lines (44 loc) · 1.88 KB
/
release-crate-version.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Copyright 2024 The Fuchsia Authors
#
# Licensed under a BSD-style license <LICENSE-BSD>, Apache License, Version 2.0
# <LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0>, or the MIT
# license <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your option.
# This file may not be copied, modified, or distributed except according to
# those terms.
name: Release new crate versions
on:
workflow_dispatch:
inputs:
version:
description: 'Crate version'
required: true
branch:
description: 'Branch to update'
required: true
default: 'main'
permissions: read-all
jobs:
release:
runs-on: ubuntu-latest
name: Release new crate versions
steps:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
ref: ${{ github.event.inputs.branch }}
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@8867c4aba1b742c39f8d0ba35429c2dfa4b6cb20 # v7.0.1
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 }}