Skip to content

Commit

Permalink
feat: use dockerhub image #1 (#3)
Browse files Browse the repository at this point in the history
* add shellscript

* change image

* update readme
  • Loading branch information
jiro4989 authored Jun 6, 2021
1 parent b2783d5 commit 786e6f8
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 6 deletions.
26 changes: 21 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,20 +82,36 @@ jobs:
## Example projects
* https://github.com/jiro4989/nimjson
* <https://github.com/jiro4989/nimjson>
## Development
### Flow
1. Create a new branch
1. Commit
1. Merge the branch into `develop` branch
1. Push `develop` branch
1. Check passing all tests
1. Create a new pull request
1. Merge the branch into `master` branch

This actions is using a DockerHub image. We must push `docker-v0.0.0` git-tag
to create a new tagged docker image. Published a new tagged docker image, and
change tag of action.yml into `develop` branch, and check passing all tests,
and merge into `master`.

### Release

#### [haya14busa/action-bumpr](https://github.com/haya14busa/action-bumpr)

You can bump version on merging Pull Requests with specific labels (bump:major,bump:minor,bump:patch).
Pushing tag manually by yourself also work.

#### [haya14busa/action-update-semver](https://github.com/haya14busa/action-update-semver)

This action updates major/minor release tags on a tag push. e.g. Update v1 and v1.2 tag when released v1.2.3.
ref: https://help.github.com/en/articles/about-actions#versioning-your-action
ref: <https://help.github.com/en/articles/about-actions#versioning-your-action>

### Lint - reviewdog integration

Expand All @@ -106,7 +122,7 @@ which is useful for Docker container based actions.

Supported linters:

- [reviewdog/action-shellcheck](https://github.com/reviewdog/action-shellcheck)
- [reviewdog/action-hadolint](https://github.com/reviewdog/action-hadolint)
- [reviewdog/action-misspell](https://github.com/reviewdog/action-misspell)
* [reviewdog/action-shellcheck](https://github.com/reviewdog/action-shellcheck)
* [reviewdog/action-hadolint](https://github.com/reviewdog/action-hadolint)
* [reviewdog/action-misspell](https://github.com/reviewdog/action-misspell)

2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ inputs:
default: 'MIT'
runs:
using: 'docker'
image: 'Dockerfile'
image: 'docker://jiro4989/build-rpm-action:2.1.0'

# Ref: https://haya14busa.github.io/github-action-brandings/
# TODO: update branding if you want.
Expand Down
35 changes: 35 additions & 0 deletions dockertag.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

set -eu

readonly VERSION=$1

readonly BOLD=$'\x1b[1m'
readonly GREEN=$'\x1b[32m'
readonly RED=$'\x1b[31m'
readonly RESET=$'\x1b[m'

now() {
date "+%Y/%m/%d %H:%M:%S"
}

info() {
echo -e "[$(now)] ${GREEN}INFO${RESET}: $*"
}

err() {
echo -e "[$(now)] ${RED}ERR${RESET}: $*"
}

if [[ ! "$VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
err "tag version (VERSION = $VERSION) is illegal. tag format must be 'v0.0.0'."
exit 1
fi

readonly TAG="docker-$VERSION"
info "TAG = $TAG"
git tag "$TAG"
git push origin "$TAG"
echo ""
info "tagging successfully."
info "see ${BOLD}https://hub.docker.com/r/jiro4989/build-deb-action${RESET} ."

0 comments on commit 786e6f8

Please sign in to comment.