Skip to content

Commit

Permalink
Merge pull request #11 from anton-yurchenko/dev
Browse files Browse the repository at this point in the history
v3.1.0
  • Loading branch information
anton-yurchenko authored Feb 17, 2020
2 parents ed774d2 + e1cf841 commit 0320a54
Show file tree
Hide file tree
Showing 12 changed files with 373 additions and 24 deletions.
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/report_a_bug.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ assignees: anton-yurchenko
### Description:
A clear and concise description of what the bug is

### Tag:
`Provide Git Tag`

### Workflow:
```Attach your GitHub Action Workflow YAML```

Expand Down
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [3.1.0] - 2020-02-17
### Added
- [Issue #10](https://github.com/anton-yurchenko/git-release/issues/10) - Release Title manipulation through `RELEASE_NAME`, `RELEASE_NAME_PREFIX`, `RELEASE_NAME_POSTFIX`. (*Thanks to [Victor](https://github.com/victoraugustolls) for suggesting a change*)

## [3.0.1] - 2020-01-08
### Fixed
- Empty release name
Expand Down Expand Up @@ -54,10 +58,10 @@ This is a major release as most of the code was refactored and some behavior was

## [1.1.0] - 2019-12-21
### Added
- [PR #3](https://github.com/anton-yurchenko/git-release/pull/3) Allow any prefix to semver tag. (*Thanks to [Taylor Becker](https://github.com/tajobe) for the PR*)
- [PR #3](https://github.com/anton-yurchenko/git-release/pull/3) - Allow any prefix to semver tag. (*Thanks to [Taylor Becker](https://github.com/tajobe) for the PR*)

### Fixed
- PreRelease overwriting Draft configuration. (*Thanks to [Taylor Becker](https://github.com/tajobe) for reporting an issue*)
- [PR #3](https://github.com/anton-yurchenko/git-release/pull/3) - PreRelease overwriting Draft configuration. (*Thanks to [Taylor Becker](https://github.com/tajobe) for reporting an issue*)

## [1.0.0] - 2019-10-01
- First stable release.
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RUN CGO_ENABLED=0 go build -ldflags="-w -s" -o /opt/app
FROM scratch
LABEL "repository"="https://github.com/anton-yurchenko/git-release"
LABEL "maintainer"="Anton Yurchenko <[email protected]>"
LABEL "version"="3.0.1"
LABEL "version"="3.1.0"
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=build /etc/passwd /etc/passwd
COPY LICENSE.md /LICENSE.md
Expand Down
34 changes: 21 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ A **GitHub Action** for creating a **GitHub Release** with **Assets** and **Chan
- Add a changelog to the release.

## Manual:
1. Add your changes to `CHANGELOG.md` in the following format (according to [keepachangelog.com](https://keepachangelog.com/en/1.0.0/ "Keep a ChangeLog")):
1. Add changes to `CHANGELOG.md` in the following format (according to [keepachangelog.com](https://keepachangelog.com/en/1.0.0/ "Keep a ChangeLog")):
```
## [3.0.0-rc.1] - 2019-12-21
## [3.1.0-rc.1] - 2019-12-21
### Added
- Feature A
- Feature B
Expand All @@ -34,7 +34,6 @@ A **GitHub Action** for creating a **GitHub Release** with **Assets** and **Chan
- Previous Artifactory
```
2. Tag a commit with Version (according to [semver.org](https://semver.org/ "Semantic Versioning")).
- Prefix support is available (for example `v3.0.1`), see configuration section in order to enable it.
3. Push and watch **Git-Release** publishing a Release on GitHub ;-)
![PIC](docs/images/log.png)

Expand All @@ -47,14 +46,7 @@ on:
tags:
- 'v*'
```
2. Add Release stage to your workflow:
- Customize configuration with **env.vars**:
- Provide a list of assets as `args` (divided by one of: `new line`, `space`, `comma`, `pipe`)
- `DRAFT_RELEASE: [true, false]` - Save release as draft instead of publishing it (default `false`).
- `PRE_RELEASE: [true, false]` - GitHub will point out that this release is identified as non-production ready (default: `false`).
- `CHANGELOG_FILE: string` - Changelog filename (default: `CHANGELOG.md`).
- `ALLOW_EMPTY_CHANGELOG: [true, false]` - Allow publishing a release without changelog (default `false`).
- `ALLOW_TAG_PREFIX: [true, false]` - Allow prefix on version Tag, for example `v3.0.1` or `release-3.0.1` (default: `false`).
2. Add Release step to your workflow:
```
- name: Release
uses: docker://antonyurchenko/git-release:latest
Expand All @@ -63,7 +55,7 @@ on:
DRAFT_RELEASE: "false"
PRE_RELEASE: "false"
CHANGELOG_FILE: "CHANGELOG.md"
ALLOW_EMPTY_CHANGELOG: "true"
ALLOW_EMPTY_CHANGELOG: "false"
ALLOW_TAG_PREFIX: "true"
with:
args: |
Expand All @@ -72,9 +64,25 @@ on:
build/windows-amd64.zip
```

[Configuration Examples](docs/example.md#examples)

<details><summary>All Configuration Options</summary>

- Provide a list of assets as `args` (divided by one of: `new line`, `space`, `comma`, `pipe`)
- `DRAFT_RELEASE (true/false as string)` - Save release as draft instead of publishing it (default `false`).
- `PRE_RELEASE (true/false as string)` - GitHub will point out that this release is identified as non-production ready (default: `false`).
- `CHANGELOG_FILE (string)` - Changelog filename (default: `CHANGELOG.md`).
- `ALLOW_EMPTY_CHANGELOG (true/false as string)` - Allow publishing a release without changelog (default `false`).
- `ALLOW_TAG_PREFIX (true/false as string)` - Allow prefix on version Tag, for example `v3.1.0` or `release-3.1.0` (default: `false`).
- `RELEASE_NAME (string)` - Complete release title (may not be combined with PREFIX or POSTFIX).
- `RELEASE_NAME_PREFIX (string)` - Release title prefix.
- `RELEASE_NAME_POSTFIX (string)` - Release title postfix.

</details>

## Remarks:
- **Git Tag** should be identical to **Changelog Version** in order for changes to be parsed properly. This does not include **Tag Prefix** like `release-*`.
- This action is automatically built at **Docker Hub**, and tagged with `latest / v3 / v3.0 / v3.0.1`. You may lock to a certain version instead of using **latest**.
- This action is automatically built at **Docker Hub**, and tagged with `latest / v3 / v3.1 / v3.1.0`. You may lock to a certain version instead of using **latest**.
(*Recommended to lock against a major version, for example* `v3`)
- Instead of using pre-built image, you may build it during the execution of your flow by changing `docker://antonyurchenko/git-release:latest` to `anton-yurchenko/git-release@master`

Expand Down
223 changes: 223 additions & 0 deletions docs/example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,223 @@
# Examples:
- You may pass data between steps in a workflow using [environmental variables](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/development-tools-for-github-actions#set-an-environment-variable-set-env)
- Some examples are based on `run` instruction, which may be easily replaces with another **GitHub Action**

## Pure SemVer tag:
![PIC](images/release.png)

<details><summary>Workflow</summary>

```yaml
name: release

on:
push:
tags:
- "*"

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1

- name: Release
uses: docker://antonyurchenko/git-release:latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: |
darwin-amd64.zip
linux-amd64.zip
windows-amd64.zip
```
</details>
## SemVer tag with prefix:
![PIC](images/example-tag-prefix.png)
<details><summary>Workflow</summary>
```yaml
name: release

on:
push:
tags:
- "*"

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1

- name: Release
uses: docker://antonyurchenko/git-release:latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ALLOW_TAG_PREFIX: "true"
with:
args: |
darwin-amd64.zip
linux-amd64.zip
windows-amd64.zip
```
</details>
## Release title with prefix:
![PIC](images/example-prefix.png)
<details><summary>Workflow</summary>
```yaml
name: release

on:
push:
tags:
- "*"

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1

- name: Release
uses: docker://antonyurchenko/git-release:latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ALLOW_TAG_PREFIX: "true"
RELEASE_NAME_PREFIX: "Release: "
with:
args: |
darwin-amd64.zip
linux-amd64.zip
windows-amd64.zip
```
</details>
## Release title with postfix:
![PIC](images/example-postfix.png)
<details><summary>Workflow</summary>
```yaml
name: release

on:
push:
tags:
- "*"

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1

- name: Release
uses: docker://antonyurchenko/git-release:latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DRAFT_RELEASE: "false"
PRE_RELEASE: "true"
CHANGELOG_FILE: "CHANGELOG.md"
ALLOW_EMPTY_CHANGELOG: "false"
ALLOW_TAG_PREFIX: "false"
RELEASE_NAME_POSTFIX: " (nightly build)"
with:
args: |
darwin-amd64.zip
linux-amd64.zip
windows-amd64.zip
```
</details>
## Release title with prefix and postfix:
![PIC](images/example-prefix-postfix.png)
<details><summary>Workflow</summary>
```yaml
name: release

on:
push:
tags:
- "*"

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1

- run: |
export PREFIX="Release: "
export POSTFIX=" (Codename: 'Ragnarok')"
echo "::set-env name=RELEASE_NAME_PREFIX::$PREFIX"
echo "::set-env name=RELEASE_NAME_POSTFIX::$POSTFIX"
- name: Release
uses: docker://antonyurchenko/git-release:latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: |
darwin-amd64.zip
linux-amd64.zip
windows-amd64.zip
```
</details>
## Release title:
![PIC](images/example-name.png)
<details><summary>Workflow</summary>
```yaml
name: release

on:
push:
tags:
- "*"

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1

- run: |
export TEXT="Release X"
echo "::set-env name=RELEASE_NAME::$TEXT"
- name: Release
uses: docker://antonyurchenko/git-release:latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CHANGELOG_FILE: "CHANGELOG.md"
ALLOW_EMPTY_CHANGELOG: "false"
ALLOW_TAG_PREFIX: "true"
with:
args: |
darwin-amd64.zip
linux-amd64.zip
windows-amd64.zip
```
</details>
Binary file added docs/images/example-name.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/example-postfix.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/example-prefix-postfix.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/example-prefix.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/example-tag-prefix.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 0320a54

Please sign in to comment.