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-10 20:09:08 +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 01:21:39 +02:00
|
|
|
- name: Commit files
|
|
|
|
run: |
|
|
|
|
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
|
|
|
git config --local user.name "github-actions[bot]"
|
|
|
|
git commit -am "Create release ${{ steps.vars.outputs.result }}"
|
2022-07-10 19:42:24 +02:00
|
|
|
|
2022-07-11 01:21:39 +02:00
|
|
|
- name: Push changes
|
|
|
|
uses: ad-m/github-push-action@master
|
|
|
|
with:
|
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
branch: ${{ github.ref }}
|
2022-07-11 01:01:50 +02:00
|
|
|
|
2022-07-11 01:52:04 +02:00
|
|
|
# - name: Create Pull Request
|
|
|
|
# uses: peter-evans/create-pull-request@v4
|
|
|
|
# with:
|
|
|
|
# base: origin/create_release/${{ steps.vars.outputs.result }}"
|
|
|
|
# branch: main
|