Remove PR machinery

This commit is contained in:
Félix Saparelli 2024-04-21 00:28:06 +12:00
parent 4023bf7124
commit 48ff7ec68b
No known key found for this signature in database
7 changed files with 3 additions and 164 deletions

View file

@ -1,7 +1,6 @@
name: CLI Release
on:
workflow_call:
workflow_dispatch:
push:
tags:

View file

@ -1,61 +0,0 @@
<!-- <%- JSON.stringify({ "release-pr": { v2: { crates, version } } }) %> -->
This is a release PR for **<%= crate.name %>** version **<%= version.actual %>**<%
if (version.actual != version.desired) {
%> (performing a <%= version.desired %> bump).<%
} else {
%>.<%
}
%>
**Use squash merge.**
<% if (crate.name == "watchexec-cli") { %>
Upon merging, this will automatically create the tag `v<%= version.actual %>`, build the CLI, and create a GitHub release.
You will still need to manually publish the cargo crate:
```
$ git switch main
$ git pull
$ git switch --detach v<%= version.actual %>
$ cargo publish -p <%= crate.name %>
```
<% } else { %>
Remember to review the crate's changelog!
Upon merging, this will create the tag `<%= crate.name %>-v<%= version.actual %>`.
You will still need to manually publish the cargo crate:
```
$ git switch main
$ git pull
$ git switch --detach <%= crate.name %>-v<%= version.actual %>
$ cargo publish -p <%= crate.name %>
```
<% } %>
To trigger builds initially: either close and then immediately re-open this PR once, or push to the branch (perhaps with edits to the README.md or CHANGELOG.md!).
<% if (pr.releaseNotes) { %>
---
_Edit release notes into the section below:_
<!-- do not change or remove this heading -->
<% if (crate.name == "watchexec-cli") { %>
### Release notes
_Software development often involves running the same commands over and over. Boring! Watchexec is a simple, standalone tool that watches a path and runs a command whenever it detects modifications. Install it today with [`cargo-binstall watchexec-cli`](https://github.com/cargo-bins/cargo-binstall), from the binaries below, find it [in your favourite package manager](https://github.com/watchexec/watchexec/blob/main/doc/packages.md), or build it from source with `cargo install watchexec-cli`._
#### In this release:
-
#### Other changes:
-
<% } else { %>
### Changelog
-
<% } %>
<% } %>

View file

@ -1,54 +0,0 @@
name: Open a release PR
on:
workflow_dispatch:
inputs:
crate:
description: Crate to release
required: true
type: choice
options:
- cli
- lib
- bosion
- events
- ignore-files
- project-origins
- signals
- supervisor
- filterer/globset
- filterer/ignore
- filterer/tagged
version:
description: Version to release
required: true
type: string
default: patch
jobs:
make-release-pr:
permissions:
id-token: write # Enable OIDC
pull-requests: write
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: chainguard-dev/actions/setup-gitsign@main
- name: Install cargo-release
uses: taiki-e/install-action@v2
with:
tool: cargo-release
- uses: cargo-bins/release-pr@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
version: ${{ inputs.version }}
crate-path: crates/${{ inputs.crate }}
pr-release-notes: ${{ inputs.crate == 'cli' }}
pr-label: release
pr-template-file: .github/workflows/release-pr.ejs
env:
GITSIGN_LOG: /tmp/gitsign.log
- run: cat /tmp/gitsign.log
if: ${{ failure() }}

View file

@ -1,45 +0,0 @@
name: Tag a release
on:
push:
branches:
- main
tags-ignore:
- "*"
jobs:
make-tag:
runs-on: ubuntu-latest
# because we control the release PR title and only allow squashes,
# PRs that are named `release: {crate-name} v{version}` will get tagged!
# the commit message will look like: `release: {crate-name} v{version} (#{pr-number})`
if: "startsWith(github.event.head_commit.message, 'release: ')"
steps:
- name: Extract tag from commit message
env:
COMMIT_MESSAGE: ${{ github.event.head_commit.message }}
run: |
set -euxo pipefail
message="$(head -n1 <<< "$COMMIT_MESSAGE")"
crate="$(cut -d ' ' -f 2 <<< "${message}")"
version="$(cut -d ' ' -f 3 <<< "${message}")"
if [[ "$crate" == "watchexec-cli" ]]; then
echo "CUSTOM_TAG=${version}" >> $GITHUB_ENV
else
echo "CUSTOM_TAG=${crate}-${version}" >> $GITHUB_ENV
fi
- uses: actions/checkout@v4
- name: Push release tag
id: tag_version
uses: mathieudutour/github-tag-action@v6.2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: ${{ env.CUSTOM_TAG }}
tag_prefix: ''
release-cli:
needs: make-tag
if: "startsWith(github.event.head_commit.message, 'release: watchexec-cli v')"
uses: ./.github/workflows/release-cli.yml
secrets: inherit

View file

@ -1,5 +1,5 @@
pre-release-commit-message = "release: events v{{version}}"
tag-prefix = "events-"
tag-prefix = "watchexec-events-"
tag-message = "watchexec-events {{version}}"
[[pre-release-replacements]]

View file

@ -1,5 +1,5 @@
pre-release-commit-message = "release: signals v{{version}}"
tag-prefix = "signals-"
tag-prefix = "watchexec-signals-"
tag-message = "watchexec-signals {{version}}"
[[pre-release-replacements]]

View file

@ -1,5 +1,5 @@
pre-release-commit-message = "release: supervisor v{{version}}"
tag-prefix = "supervisor-"
tag-prefix = "watchexec-supervisor-"
tag-message = "watchexec-supervisor {{version}}"
[[pre-release-replacements]]