2022-07-11 00:31:05 +02:00
|
|
|
name: Prepare new release
|
2022-07-10 19:23:54 +02:00
|
|
|
on:
|
2022-07-10 22:48:32 +02:00
|
|
|
create:
|
|
|
|
branches:
|
|
|
|
- 'create_release/*'
|
2022-07-10 19:23:54 +02:00
|
|
|
jobs:
|
2022-07-10 22:48:32 +02:00
|
|
|
release:
|
2022-07-10 19:23:54 +02:00
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
steps:
|
2022-07-11 00:52:09 +02:00
|
|
|
- uses: actions/checkout@v3
|
2022-07-11 02:16:38 +02:00
|
|
|
|
2022-07-10 19:23:54 +02:00
|
|
|
- name: Install latest stable
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
2022-07-10 22:48:32 +02:00
|
|
|
override: true
|
2022-07-11 00:44:24 +02:00
|
|
|
profile: minimal
|
2022-07-10 19:23:54 +02:00
|
|
|
|
2022-07-10 22:48:32 +02:00
|
|
|
- name: Install cargo-edit
|
|
|
|
uses: baptiste0928/cargo-install@v1
|
2022-07-10 19:35:23 +02:00
|
|
|
with:
|
2022-07-10 22:48:32 +02:00
|
|
|
crate: cargo-edit
|
2022-07-11 01:54:35 +02:00
|
|
|
version: 0.9.1
|
2022-07-10 19:35:23 +02:00
|
|
|
|
2022-07-10 22:48:32 +02:00
|
|
|
- name: Determine version
|
|
|
|
id: vars
|
|
|
|
uses: actions/github-script@v5
|
2022-07-10 19:42:24 +02:00
|
|
|
with:
|
2022-07-10 22:48:32 +02:00
|
|
|
script: |
|
|
|
|
const { GITHUB_REF } = process.env
|
|
|
|
const version = GITHUB_REF.replace('refs/heads/create_release/', '')
|
|
|
|
console.log(`Got the following version: ${version}`)
|
|
|
|
return version
|
|
|
|
result-encoding: string
|
|
|
|
|
|
|
|
- name: Bump version
|
2022-07-11 00:11:59 +02:00
|
|
|
run: |
|
|
|
|
cargo set-version --workspace ${{ steps.vars.outputs.result }}
|
|
|
|
cargo generate-lockfile
|
2022-07-10 22:48:32 +02:00
|
|
|
|
2022-07-11 03:13:25 +02:00
|
|
|
- name: Create Pull Request
|
|
|
|
uses: peter-evans/create-pull-request@v4
|
|
|
|
with:
|
2022-07-11 03:19:11 +02:00
|
|
|
title: "Create release ${{ steps.vars.outputs.result }}"
|
|
|
|
commit-message: "Create release ${{ steps.vars.outputs.result }}"
|
|
|
|
body: "Create release ${{ steps.vars.outputs.result }}"
|
2022-07-11 03:13:25 +02:00
|
|
|
branch: main
|
2022-07-11 03:23:02 +02:00
|
|
|
delete-branch: true
|