qbittorrent_web_api/.github/workflows/release.yml

60 lines
1.6 KiB
YAML
Raw Permalink Normal View History

2022-07-11 00:31:05 +02:00
name: Prepare new release
2022-07-11 16:14:17 +02:00
2022-07-10 19:23:54 +02:00
on:
2022-07-10 22:48:32 +02:00
create:
branches:
2022-07-11 16:14:17 +02:00
env:
CARGO_TERM_COLOR: always
2022-07-10 19:23:54 +02:00
jobs:
2022-07-10 22:48:32 +02:00
release:
2022-07-11 17:07:40 +02:00
runs-on: ubuntu-22.04
2022-07-11 16:14:17 +02:00
2022-07-11 04:06:12 +02:00
if: "startsWith(github.ref, 'refs/heads/create_release/')"
2022-07-11 16:14:17 +02:00
2022-07-10 19:23:54 +02:00
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 20:15:58 +02:00
# Need to use our own token in order to trigger additional workflows
# after the branch is crated.
token: ${{ secrets.PAT_TOKEN }}
2022-07-11 03:19:11 +02:00
title: "Create release ${{ steps.vars.outputs.result }}"
2022-07-12 23:10:36 +02:00
commit-message: "Create release ${{ steps.vars.outputs.result }}"
body: "bors r+"
2022-07-11 17:19:15 +02:00
base: main
2022-07-11 17:13:03 +02:00
branch: create_release/${{ steps.vars.outputs.result }}
2022-07-11 03:23:02 +02:00
delete-branch: true