From 927bbcd4d7391a61f708a07a35ccce5395f3a09f Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Fri, 12 Jun 2020 07:55:24 -0400 Subject: [PATCH] v0.3.1: hotfix in json parsing --- .drone.yml | 17 +++++++++++------ CHANGELOG.md | 6 +++++- Cargo.lock | 2 +- Cargo.toml | 2 +- README.md | 22 +++++++++++++++++++++- VERSION | 2 +- src/gitea.rs | 22 ---------------------- 7 files changed, 40 insertions(+), 33 deletions(-) diff --git a/.drone.yml b/.drone.yml index b85dd7d..0977dc5 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2,11 +2,6 @@ kind: pipeline name: tests/release steps: - - name: fetch tags - image: alpine/git - commands: - - git fetch --tags - - name: rust tests image: "rust:1" pull: always @@ -16,8 +11,18 @@ steps: event: - push + - name: fetch tags + image: alpine/git + commands: + - git fetch --tags + when: + event: + - push + branch: + - master + - name: auto-release - image: xena/gitea-release:0.3.0 + image: xena/gitea-release:0.3.1 settings: auth_username: cadey default_branch: master diff --git a/CHANGELOG.md b/CHANGELOG.md index d34e80a..8e49181 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +## 0.3.1 + +Hotfix in json parsing + ## 0.3.0 Allows for a customizable default branch name for the drone plugin using either @@ -15,7 +19,7 @@ need to hard-code your default branch name, add the config like this: ```yaml - name: auto-release - image: xena/gitea-release:0.3.0 + image: xena/gitea-release:0.3.1 settings: auth_username: cadey default_branch: trunk diff --git a/Cargo.lock b/Cargo.lock index 41a1f78..2ab47ee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -326,7 +326,7 @@ dependencies = [ [[package]] name = "gitea-release" -version = "0.3.0" +version = "0.3.1" dependencies = [ "anyhow", "byte-unit", diff --git a/Cargo.toml b/Cargo.toml index e32acaa..28658d5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "gitea-release" -version = "0.3.0" +version = "0.3.1" authors = ["Christine Dodrill "] edition = "2018" diff --git a/README.md b/README.md index b286e4e..b709c36 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ To use this as a drone plugin, add the following to your `.drone.yml` under the ```yaml - name: auto-release - image: xena/gitea-release:0.2.7 + image: xena/gitea-release:0.3.1 settings: auth_username: cadey changelog_path: ./CHANGELOG.md @@ -59,6 +59,26 @@ by adding this before your auto-release step: - git fetch --tags ``` +The default branch will automatically be derived from the Gitea API. If you need +to hard-code your default branch name for some reason, add the `default_branch` +setting like this: + +```yaml + - name: auto-release + image: xena/gitea-release:0.3.1 + settings: + auth_username: cadey + default_branch: trunk + gitea_server: https://tulpa.dev + gitea_token: + from_secret: GITEA_TOKEN + when: + event: + - push + branch: + - trunk +``` + ## CHANGELOG.md and VERSION files The `CHANGELOG.md` file is based on the [Keep a Changelog][kacl] format, but diff --git a/VERSION b/VERSION index 0d91a54..9e11b32 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.3.0 +0.3.1 diff --git a/src/gitea.rs b/src/gitea.rs index c2e8999..12ab662 100644 --- a/src/gitea.rs +++ b/src/gitea.rs @@ -129,8 +129,6 @@ pub struct Repo { pub default_branch: String, pub description: String, pub empty: bool, - pub external_tracker: ExternalTracker, - pub external_wiki: ExternalWiki, pub fork: bool, pub forks_count: i64, pub full_name: String, @@ -140,7 +138,6 @@ pub struct Repo { pub html_url: String, pub id: i64, pub ignore_whitespace_conflicts: bool, - pub internal_tracker: InternalTracker, pub mirror: bool, pub name: String, pub open_issues_count: i64, @@ -174,25 +171,6 @@ pub(crate) async fn get_repo( .await?) } -#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] -pub struct ExternalTracker { - pub external_tracker_format: String, - pub external_tracker_style: String, - pub external_tracker_url: String, -} - -#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] -pub struct ExternalWiki { - pub external_wiki_url: String, -} - -#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] -pub struct InternalTracker { - pub allow_only_contributors_to_track_time: bool, - pub enable_issue_dependencies: bool, - pub enable_time_tracker: bool, -} - #[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct Owner { pub avatar_url: String,