cmd/release: exit if the tag already exists
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details

This commit is contained in:
Cadey Ratio 2020-06-05 10:50:34 -04:00
parent 7d09c0dee0
commit 235560fc71
7 changed files with 16 additions and 6 deletions

View File

@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased ## Unreleased
## 0.2.7
### FIXED
Exit if this version already exists
## 0.2.6 ## 0.2.6
A fix from @kivikakk to remove the use of RefCells in markdown parsing A fix from @kivikakk to remove the use of RefCells in markdown parsing

2
Cargo.lock generated
View File

@ -326,7 +326,7 @@ dependencies = [
[[package]] [[package]]
name = "gitea-release" name = "gitea-release"
version = "0.2.5" version = "0.2.7"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"byte-unit", "byte-unit",

View File

@ -1,6 +1,6 @@
[package] [package]
name = "gitea-release" name = "gitea-release"
version = "0.2.6" version = "0.2.7"
authors = ["Christine Dodrill <me@christine.website>"] authors = ["Christine Dodrill <me@christine.website>"]
edition = "2018" edition = "2018"

View File

@ -29,7 +29,7 @@ To use this as a drone plugin, add the following to your `.drone.yml`:
```yaml ```yaml
- name: auto-release - name: auto-release
image: xena/gitea-release:0.2.6 image: xena/gitea-release:0.2.7
settings: settings:
auth_username: cadey auth_username: cadey
changelog_path: ./CHANGELOG.md changelog_path: ./CHANGELOG.md

View File

@ -13,8 +13,8 @@
CLOSED: [2020-05-31 Sun 12:50] CLOSED: [2020-05-31 Sun 12:50]
** DONE upload ** DONE upload
CLOSED: [2020-05-30 Sat 15:15] CLOSED: [2020-05-30 Sat 15:15]
** DONE drone plugin
** TODO drone plugin CLOSED: [2020-06-01 Mon 10:10]
* Core Features * Core Features
** DONE Gitea API client ** DONE Gitea API client
CLOSED: [2020-05-30 Sat 10:52] CLOSED: [2020-05-30 Sat 10:52]

View File

@ -1 +1 @@
0.2.6 0.2.7

View File

@ -15,6 +15,10 @@ pub(crate) async fn run(
if !git::has_tag(&repo, tag.clone())? { if !git::has_tag(&repo, tag.clone())? {
git::tag_version(&repo, tag.clone(), desc.clone())?; git::tag_version(&repo, tag.clone(), desc.clone())?;
let _ = git::push_tags(&repo); let _ = git::push_tags(&repo);
} else
/* The tag already exists */
{
return Ok(());
} }
let desc = changelog::read(fname, tag.clone())?; let desc = changelog::read(fname, tag.clone())?;