-
Notifications
You must be signed in to change notification settings - Fork 6
43 lines (41 loc) · 1.53 KB
/
release-dispatch.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
name: release-dispatch
on:
workflow_dispatch:
inputs:
version:
description: Version to release
required: true
type: string
jobs:
propose-release:
permissions:
pull-requests: write
contents: write
runs-on: ubuntu-latest
container:
image: ghcr.io/dojoengine/dojo-dev:5d61184
steps:
# Workaround described here: https://github.com/actions/checkout/issues/760
- uses: actions/checkout@v3
- run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- run: cargo release version ${{ inputs.version }} --execute --no-confirm && cargo release replace --execute --no-confirm
- id: version_info
run: |
cargo install cargo-get
echo "version=$(cargo get workspace.package.version)" >> $GITHUB_OUTPUT
- uses: peter-evans/create-pull-request@v5
id: pr
with:
# We have to use a PAT in order to trigger ci
token: ${{ secrets.CREATE_PR_TOKEN }}
title: "Prepare release: v${{ steps.version_info.outputs.version }}"
commit-message: "Prepare release: v${{ steps.version_info.outputs.version }}"
branch: prepare-release
base: main
delete-branch: true
- name: Enable auto-squash
if: ${{ steps.pr.outputs.pull-request-number }}
run: gh pr merge --auto --squash "${{ steps.pr.outputs.pull-request-number }}"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.CREATE_PR_TOKEN }}