Skip to content

Commit 560f58f

Browse files
committed
chore: publish on tag push
1 parent 5f3662c commit 560f58f

File tree

3 files changed

+7
-33
lines changed

3 files changed

+7
-33
lines changed

.github/workflows/release.yml

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
name: Release
22

33
on:
4-
workflow_dispatch:
5-
inputs:
6-
version:
7-
type: choice
8-
required: true
9-
description: 'Version number to bump'
10-
options:
11-
- patch
12-
- minor
13-
- major
4+
push:
5+
tags:
6+
- "v*"
7+
148

159
permissions:
1610
contents: write
@@ -47,26 +41,6 @@ jobs:
4741
toolchain: stable
4842
override: true
4943

50-
- name: Install `cargo-edit`
51-
run: cargo install cargo-edit
52-
53-
- id: cargo-set-version
54-
name: Set Version
55-
run: cargo set-version --bump ${{ inputs.version }}
56-
57-
- name: Set Crate Version as Environment Variable
58-
run: |
59-
CARGO_TOML_VERSION=$(awk -F ' = ' '$1 ~ /version/ { gsub(/[\"]/, "", $2); printf("%s",$2) }' Cargo.toml)
60-
echo "CRATE_VERSION=$CARGO_TOML_VERSION" >> $GITHUB_ENV
61-
62-
- name: Create Commit
63-
run: |
64-
git config --global user.name 'github-actions[bot]'
65-
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
66-
git add .
67-
git commit -m "chore: bump version to v$CRATE_VERSION"
68-
git push origin main --follow-tags
69-
7044
- name: Login to Crates.io
7145
run: cargo login ${CRATES_IO_TOKEN}
7246
env:
@@ -81,6 +55,6 @@ jobs:
8155
with:
8256
script: |
8357
await github.request(`POST /repos/${{ github.repository }}/releases`, {
84-
tag_name: "v${{ env.CRATE_VERSION }}",
58+
tag_name: "${{ github.ref }}",
8559
generate_release_notes: true
8660
});

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "http-server"
3-
version = "0.8.8"
3+
version = "0.8.9"
44
authors = ["Esteban Borai <estebanborai@gmail.com>"]
55
edition = "2021"
66
description = "Simple and configurable command-line HTTP server"

0 commit comments

Comments
 (0)