Skip to content

fix(deps): update rust crate regex to 1.11.0 #2213

fix(deps): update rust crate regex to 1.11.0

fix(deps): update rust crate regex to 1.11.0 #2213

Workflow file for this run

on:
push:
branches:
- "*"
pull_request:
workflow_dispatch:
merge_group:
jobs:
docker-build:
uses: PurpleBooth/common-pipelines/.github/workflows/docker-build.yml@main
rust-check:
uses: PurpleBooth/common-pipelines/.github/workflows/rust-check.yml@main
with:
ubuntu_before_script: sudo apt-get install -y libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev
specdown:
uses: PurpleBooth/common-pipelines/.github/workflows/specdown-check.yml@main
with:
ubuntu_before_script: sudo apt-get install -y libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev
release:
if: github.ref == 'refs/heads/main'
needs:
- docker-build
- specdown
- rust-check
outputs:
current_version: ${{ steps.current_version.outputs.current_version }}
previous_version: ${{ steps.previous_version.outputs.previous_version }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
with:
fetch-depth: 0
- uses: taiki-e/install-action@cargo-binstall
- name: Get tags
run: git fetch --tags origin
- shell: bash
run: cargo binstall --no-confirm cargo-edit
- shell: bash
run: cargo binstall --no-confirm --locked cocogitto
- id: previous_version
run: |
echo "previous_version=$( cog get-version 2> /dev/null )" >> "$GITHUB_OUTPUT"
shell: bash
- name: Semver release
id: release
run: |
git config --global user.name "cog-bot"
git config --global user.email "cog@example.com"
cog bump --auto
- id: current_version
run: |
echo "current_version=$( cog get-version 2> /dev/null )" >> "$GITHUB_OUTPUT"
shell: bash
cargo-publish:
if: needs.release.outputs.current_version != needs.release.outputs.previous_version
needs:
- release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Checkout the repository
with:
ref: v${{ needs.release.outputs.current_version }}
- uses: actions-rs/toolchain@v1.0.7
with:
toolchain: stable
profile: default
- run: sudo apt-get install -y libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev
- name: Publish mit-hook-test-helper to Crates
uses: nick-invision/retry@v3.0.0
with:
timeout_minutes: 30
max_attempts: 10
command: |
cargo login "$CARGO_TOKEN"
( cd mit-hook-test-helper && cargo publish )
env:
CARGO_TOKEN: ${{ secrets.CARGO_TOKEN }}
- name: Publish mit-commit-message-lints to Crates
uses: nick-invision/retry@v3.0.0
with:
timeout_minutes: 30
max_attempts: 10
command: |
cargo login "$CARGO_TOKEN"
( cd mit-commit-message-lints && cargo publish )
env:
CARGO_TOKEN: ${{ secrets.CARGO_TOKEN }}
- name: Publish mit-commit-msg to Crates
uses: nick-invision/retry@v3.0.0
with:
timeout_minutes: 30
max_attempts: 10
command: |
cargo login "$CARGO_TOKEN"
( cd mit-commit-msg && cargo publish )
env:
CARGO_TOKEN: ${{ secrets.CARGO_TOKEN }}
- name: Publish mit-pre-commit to Crates
uses: nick-invision/retry@v3.0.0
with:
timeout_minutes: 30
max_attempts: 10
command: |
cargo login "$CARGO_TOKEN"
( cd mit-pre-commit && cargo publish )
env:
CARGO_TOKEN: ${{ secrets.CARGO_TOKEN }}
- name: Publish mit-prepare-commit-msg to Crates
uses: nick-invision/retry@v3.0.0
with:
timeout_minutes: 30
max_attempts: 10
command: |
cargo login "$CARGO_TOKEN"
( cd mit-prepare-commit-msg && cargo publish )
env:
CARGO_TOKEN: ${{ secrets.CARGO_TOKEN }}
- name: Publish git-mit to Crates
uses: nick-invision/retry@v3.0.0
with:
timeout_minutes: 30
max_attempts: 10
command: |
cargo login "$CARGO_TOKEN"
( cd git-mit && cargo publish )
env:
CARGO_TOKEN: ${{ secrets.CARGO_TOKEN }}
- name: Publish git-mit-config to Crates
uses: nick-invision/retry@v3.0.0
with:
timeout_minutes: 30
max_attempts: 10
command: |
cargo login "$CARGO_TOKEN"
( cd git-mit-config && cargo publish )
env:
CARGO_TOKEN: ${{ secrets.CARGO_TOKEN }}
- name: Publish git-mit-install to Crates
uses: nick-invision/retry@v3.0.0
with:
timeout_minutes: 30
max_attempts: 10
command: |
cargo login "$CARGO_TOKEN"
( cd git-mit-install && cargo publish )
env:
CARGO_TOKEN: ${{ secrets.CARGO_TOKEN }}
- name: Publish git-mit-relates-to to Crates
uses: nick-invision/retry@v3.0.0
with:
timeout_minutes: 30
max_attempts: 10
command: |
cargo login "$CARGO_TOKEN"
( cd git-mit-relates-to && cargo publish )
env:
CARGO_TOKEN: ${{ secrets.CARGO_TOKEN }}
build:
if: needs.release.outputs.current_version != needs.release.outputs.previous_version
needs:
- release
runs-on: ${{ matrix.os }}
steps:
- run: ${{ matrix.install }}
env:
DEBIAN_FRONTEND: noninteractive
- uses: actions/checkout@v4
with:
lfs: true
ref: v${{ needs.release.outputs.current_version }}
- uses: actions/cache@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
with:
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
path: |
~/.cargo/registry
~/.cargo/git
~/.cargo/bin
target
- uses: taiki-e/install-action@cargo-binstall
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
target: ${{ matrix.target }}
- run: cargo build --release --locked
- id: get_repository_name
run: echo "REPOSITORY_NAME=$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $2}' | sed -e "s/:refs//")" >> "$GITHUB_OUTPUT"
shell: bash
- name: Move binary to upload location
env:
TARGET: ${{ matrix.target }}
EXTENSION: ${{ matrix.suffix }}
REPOSITORY_NAME: ${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}
run: mv "./target/release/mit-commit-msg$EXTENSION" "./mit-commit-msg-$TARGET$EXTENSION"
shell: bash
- name: Move binary to upload location
env:
TARGET: ${{ matrix.target }}
EXTENSION: ${{ matrix.suffix }}
REPOSITORY_NAME: ${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}
run: mv "./target/release/git-mit-config$EXTENSION" "./git-mit-config-$TARGET$EXTENSION"
shell: bash
- name: Move binary to upload location
env:
TARGET: ${{ matrix.target }}
EXTENSION: ${{ matrix.suffix }}
REPOSITORY_NAME: ${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}
run: mv "./target/release/mit-pre-commit$EXTENSION" "./mit-pre-commit-$TARGET$EXTENSION"
shell: bash
- name: Move binary to upload location
env:
TARGET: ${{ matrix.target }}
EXTENSION: ${{ matrix.suffix }}
REPOSITORY_NAME: ${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}
run: mv "./target/release/mit-prepare-commit-msg$EXTENSION" "./mit-prepare-commit-msg-$TARGET$EXTENSION"
shell: bash
- name: Move binary to upload location
env:
TARGET: ${{ matrix.target }}
EXTENSION: ${{ matrix.suffix }}
REPOSITORY_NAME: ${{ steps.get_repository_name.outputs.REPOSITORY_NAME }}
run: mv "./target/release/git-mit$EXTENSION" "./git-mit-$TARGET$EXTENSION"
shell: bash
- uses: actions/upload-artifact@v4
with:
name: bins-${{ matrix.target }}${{ matrix.suffix }}
path: ./*${{ matrix.target }}${{ matrix.suffix }}
strategy:
matrix:
include:
- os: macos-latest
suffix: ""
target: aarch64-apple-darwin
install: echo nothing to install
- os: macos-latest
suffix: ""
target: x86_64-apple-darwin
install: echo nothing to install
- os: ubuntu-latest
suffix: ""
target: x86_64-unknown-linux-gnu
install: sudo apt-get install -y libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev
- os: windows-latest
suffix: .exe
target: x86_64-pc-windows-msvc
install: echo nothing to install
generate-github-release:
permissions:
id-token: write
attestations: write
contents: write
if: needs.release.outputs.current_version != needs.release.outputs.previous_version
needs:
- release
- build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
lfs: true
fetch-depth: 0
ref: v${{ needs.release.outputs.current_version }}
- uses: anchore/sbom-action@v0
- uses: actions/download-artifact@v4
with:
merge-multiple: true
path: bins
pattern: bins-*
- name: Attest binaries
uses: actions/attest-build-provenance@v1
with:
subject-path: bins/**/*
- name: Sign binaries
run: |
cd bins
for file in *; do
if [[ -f "$file" ]]; then
sha256sum "$file" > "$file.sha256"
md5sum "$file" > "$file.md5"
fi
done
- uses: cargo-bins/cargo-binstall@main
name: Install cargo binstall
- shell: bash
run: cargo binstall --no-confirm --locked cocogitto
- run: cog changelog --at "$TAG_V" > CHANGELOG.md
shell: bash
env:
TAG_V: v${{ needs.release.outputs.current_version }}
- id: create_release
uses: ncipollo/release-action@v1.14.0
with:
allowUpdates: true
token: ${{ secrets.GITHUB_TOKEN }}
bodyFile: "CHANGELOG.md"
name: Release v${{ needs.release.outputs.current_version }}
tag: v${{ needs.release.outputs.current_version }}
artifacts: ./bins/**/*
docker-push:
if: needs.release.outputs.current_version != needs.release.outputs.previous_version
needs:
- release
uses: PurpleBooth/common-pipelines/.github/workflows/docker-push.yml@main
with:
current_version: ${{ needs.release.outputs.current_version }}
generate-formula:
if: needs.release.outputs.current_version != needs.release.outputs.previous_version
needs:
- release
name: Generate Homebrew Formula
runs-on: ubuntu-latest
steps:
- uses: PurpleBooth/generate-formula-action@03882ef6068c2622837703f93b664dcc8840d43e # v0.1.14
with:
current_version: ${{ needs.release.outputs.current_version }}
previous_version: ${{ needs.release.outputs.previous_version }}
committer_token: ${{ secrets.COMMITTER_TOKEN }}
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg_passphrase: ${{ secrets.GPG_PASSPHRASE }}