Skip to content
This repository has been archived by the owner on Dec 1, 2022. It is now read-only.

Commit

Permalink
Merge #31
Browse files Browse the repository at this point in the history
31: Publish tag as r=CAD97 a=CAD97

bors: r+
  • Loading branch information
bors[bot] committed Feb 19, 2018
2 parents d733410 + 0b45f79 commit 68f109e
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ matrix:
script:
- cargo clippy -- -D clippy
# GitHub Pages
- env: CARGO_GHP_VERSION=0.3.1
- env: CARGO_GHP_VERSION=0.3.2
install:
- cargo install cargo-ghp-upload --version $CARGO_GHP_VERSION || echo "cargo-ghp-upload already installed"
after_success:
- cargo ghp-upload -vvvr
allow_failures:
- env: CARGO_GHP_VERSION=0.3.1
- env: CARGO_GHP_VERSION=0.3.2
fast_finish: true

script:
Expand Down
15 changes: 10 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,29 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [0.3.2]

- Tag builds now publish to `/[tag]/` instead of `/HEAD/`

## [0.3.1]

- Fixed builds when `./target/ghp` does not exists and the target repo has a GHP branch

## [0.3.0]
## [0.3.0] [YANKED]

- Fixed builds on Travis always being picked up as a tag build instead of a branch build
- Added `--publish-tags` to publish docs for tags (GitHub releases)

## [0.2.0]
## [0.2.0] [YANKED]

- Change CLI syntax so that it works as a subcommand (yanked broken 0.1)

## [0.1.1] [YANKED: broken]
## [0.1.1] [YANKED]

- Removed package.include key from Cargo.toml so more things are in the cargo package
- Improvements to CI

## [0.1.0] [YANKED: broken]
## [0.1.0] [YANKED]

- Split out of [roblabla/cargo-travis](https://github.com/roblabla/cargo-travis)
- Includes rename from `cargo-doc-upload` to `cargo-ghp-upload`
Expand All @@ -38,7 +42,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Now can infer much more context from Git if not in Travis-like environment
- Default commit message changed

[Unreleased]: https://github.com/crate-ci/cargo-ghp-upload/compare/0.3.1...master
[Unreleased]: https://github.com/crate-ci/cargo-ghp-upload/compare/0.3.2...master
[0.3.2]: https://github.com/crate-ci/cargo-ghp-upload/compare/0.3.1...0.3.2
[0.3.1]: https://github.com/crate-ci/cargo-ghp-upload/compare/0.3.0...0.3.1
[0.3.0]: https://github.com/crate-ci/cargo-ghp-upload/compare/0.2.0...0.3.0
[0.2.0]: https://github.com/crate-ci/cargo-ghp-upload/compare/0.1.1...0.2.0
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cargo-ghp-upload"
version = "0.3.1"
version = "0.3.2"
authors = ["CAD97 <[email protected]>"]
description = "Upload documentation straight to GitHub Pages, maintaining branch separation and history"

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ To do that, you can minimally include the following in your Travis matrix:
```yaml
matrix:
include:
- env: GHP_UPLOAD_VERSION=0.3.1
- env: GHP_UPLOAD_VERSION=0.3.2
install:
- cargo install --version $GHP_UPLOAD_VERSION cargo-ghp-upload
script:
Expand Down Expand Up @@ -53,7 +53,7 @@ This crate will not change the contents of the uploaded directory.
## Customization

```
cargo-ghp-upload 0.3.1
cargo-ghp-upload 0.3.2
CAD97 <[email protected]>
Upload documentation straight to GitHub Pages, maintaining branch separation and history

Expand Down
6 changes: 2 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,10 @@ fn get_context(args: &Args) -> Result<Context> {
bail!("Insecure environment found; stopping");
}
let tag = env::var("TRAVIS_TAG")?;
if tag.is_empty() {
context.branch = Some(env::var("TRAVIS_BRANCH")?);
} else {
if !tag.is_empty() {
context.tag = Some(tag);
}
context.branch = Some(env::var("TRAVIS_BRANCH")?);
context.pull_request = env::var("TRAVIS_PULL_REQUEST")? != "false";
let repo_slug = env::var("TRAVIS_REPO_SLUG")?;
context.origin = Some(if let Some(ref token) = args.token {
Expand Down Expand Up @@ -319,7 +318,6 @@ fn run() -> Result<()> {
let branch = context
.branch
.as_ref()
.or_else(|| context.tag.as_ref())
.ok_or_else(|| err_msg("No branch/tag determined"))?;
let origin = context
.origin
Expand Down

0 comments on commit 68f109e

Please sign in to comment.