From 749c93fd9fc1764a868f1354f22f3c6010841d7b Mon Sep 17 00:00:00 2001 From: Rosiney Gomes Pereira Date: Sat, 17 Apr 2021 09:01:48 -0300 Subject: [PATCH 1/3] feat: generate auto release --- .github/workflows/release.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..d00758b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,34 @@ +on: + push: + tags: + - 'v*' + +name: Upload Release Asset + +jobs: + build: + name: Upload Release Asset + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v2 + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: .mkdkr + asset_name: mkdkr + asset_content_type: application/x-sh \ No newline at end of file From fd816d5fb2b650a06278d7ec7f85ba0f0d9b58e7 Mon Sep 17 00:00:00 2001 From: Rosiney Gomes Pereira Date: Sat, 17 Apr 2021 09:03:24 -0300 Subject: [PATCH 2/3] docs: use mkdkr without copy file first --- README.md | 86 +++++++++++++++++++++++++++++++------------------------ 1 file changed, 48 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index 085019a..adeb749 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ [![kcov](https://img.shields.io/endpoint?url=https%3A%2F%2Fmkdkr.surge.sh%2Fcoverage.json)](https://mkdkr.surge.sh/) [![CodeFactor](https://www.codefactor.io/repository/github/rosineygp/mkdkr/badge)](https://www.codefactor.io/repository/github/rosineygp/mkdkr) ![Docker Pulls](https://img.shields.io/docker/pulls/rosiney/mkdkr) +![GitHub all releases](https://img.shields.io/github/downloads/rosineygp/mkdkr/total) > mkdkr = Makefile + Docker @@ -38,42 +39,44 @@ Super small and powerful framework for build CI pipeline, scripted with Makefile Table of contents ----------------- -* [Usage](#usage) - * [Installation](#installation) - * [Create Makefile](#create-makefile) - * [Execute](#execute) - * [Result](#result) - * [Export](#export) -* [Reason](#reason) -* [Functions](#functions) - * [@$(dkr)](#dkr) - * [instance:](#instance) - * [service:](#service) - * [dind:](#dind) - * [run:](#run) - * [var-run:](#var-run) - * [login:](#login) - * [retry:](#retry) - * [log:](#log) - * [push:](#push) - * [pull:](#pull) - * [cd:](#cd) -* [Includes](#includes) - * [Explicit](#explicit) - * [Implicit](#implicit) - * [mkdkr.csv](#mkdkr.csv) - * [Collection](#collection) -* [Helpers](#helpers) -* [Examples](#examples) - * [Simple](#simple) - * [Service](#service) - * [DIND](#dind) - * [Escapes](#escapes) - * [Shell](#shell) - * [Stdout](#stdout) - * [Pipelines](#pipelines) -* [Environment Variables](#environment-variables) -* [Migration](#migration) +- [mkdkr](#mkdkr) + - [Table of contents](#table-of-contents) +- [Usage](#usage) + - [Installation](#installation) + - [Makefile](#makefile) + - [Execute](#execute) + - [Result](#result) + - [Export](#export) +- [Reason](#reason) +- [Functions](#functions) + - [@$(dkr)](#dkr) + - [instance:](#instance) + - [service:](#service) + - [dind:](#dind) + - [run:](#run) + - [var-run:](#var-run) + - [login:](#login) + - [retry:](#retry) + - [log:](#log) + - [push:](#push) + - [pull:](#pull) + - [cd:](#cd) +- [Includes](#includes) + - [Explicit](#explicit) + - [Implicit](#implicit) + - [mkdkr.csv](#mkdkrcsv) + - [Collection](#collection) +- [Helpers](#helpers) +- [Examples](#examples) + - [Simple](#simple) + - [Service](#service-1) + - [DIND](#dind-1) + - [Escapes](#escapes) + - [Shell](#shell) + - [Stdout](#stdout) + - [Pipelines](#pipelines) +- [Environment Variables](#environment-variables) +- [Migration](#migration) # Usage @@ -81,7 +84,7 @@ Table of contents ```bash # Download .mkdkr -curl https://raw.githubusercontent.com/rosineygp/mkdkr/master/.mkdkr > .mkdkr +curl -fsSL https://github.com/rosineygp/mkdkr/releases/latest/download/mkdkr > .mkdkr # not required, but can be used as template curl https://raw.githubusercontent.com/rosineygp/mkdkr/master/examples/simple.mk > Makefile @@ -93,7 +96,7 @@ Create a file with name Makefile and paste the following content ```Makefile # Required header -include $(shell bash .mkdkr init) +include $(shell if [ ! -f .mkdkr ]; then curl -fsSL https://github.com/rosineygp/mkdkr/releases/latest/download/mkdkr > .mkdkr; fi && bash .mkdkr init) job: # job name @$(dkr) # required: load mkdkr (docker layer) @@ -101,6 +104,13 @@ job: # job name run: echo "hello mkdkr!" # execute a command inside container ``` +.gitignore (optional) + +```.gitignore +.tmp +.mkdkr +``` + ## Execute ```bash From 2c2e9e8dd9a4c73dfbc3cdbea1afa0acb7fde730 Mon Sep 17 00:00:00 2001 From: Rosiney Gomes Pereira Date: Sat, 17 Apr 2021 09:06:58 -0300 Subject: [PATCH 3/3] fix: just trim yaml file --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d00758b..ecfe6d4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,7 @@ jobs: draft: false prerelease: false - name: Upload Release Asset - id: upload-release-asset + id: upload-release-asset uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}