-
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from sinamics/dev
Dev
- Loading branch information
Showing
5 changed files
with
103 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
# Build new docker image when a new tag is pushed, and generate changelog and release notes and use the tag as the release name. | ||
# if the tag has beta or alfa in the name, set the release as a pre-release. | ||
|
||
name: Push Tag build container | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
# trigger workflow manually | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: "Release version (e.g. v0.0.2)" | ||
required: true | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: main | ||
fetch-depth: 0 | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Create short sha | ||
run: echo "SHORT_SHA=${GITHUB_SHA::7}" >> $GITHUB_ENV | ||
|
||
- name: Bump version and push tag | ||
uses: anothrNick/[email protected] # Don't use @master unless you're happy to test the latest version | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
WITH_V: true | ||
|
||
- name: "Get Previous tag" | ||
id: previoustag | ||
uses: "WyriHaximus/github-action-get-previous-tag@v1" | ||
|
||
- name: Extract version number | ||
id: extract_version | ||
run: | | ||
echo "raw_tag=${{ steps.previoustag.outputs.tag }}" | ||
version_number="${{ steps.previoustag.outputs.tag }}" | ||
if [[ ${version_number:0:1} == "v" ]]; then | ||
version_number=${version_number:1} | ||
fi | ||
echo "version_number=$version_number" | ||
echo "::set-output name=version_number::$version_number" | ||
- name: Build and push | ||
id: docker_build | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
push: true | ||
tags: | | ||
${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_REPOSITORY }}:latest | ||
${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_REPOSITORY }}:${{ steps.extract_version.outputs.version_number }} | ||
tagged-release: | ||
name: "Tagged Release" | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
ref: main | ||
|
||
- name: "Get Previous tag" | ||
id: previoustag | ||
uses: "WyriHaximus/github-action-get-previous-tag@v1" | ||
|
||
- uses: "marvinpinto/action-automatic-releases@latest" | ||
with: | ||
repo_token: "${{ secrets.GITHUB_TOKEN }}" | ||
prerelease: ${{ contains(github.ref, 'beta') || contains(github.ref, 'alfa') }} | ||
automatic_release_tag: ${{ github.event.inputs.version || steps.previoustag.outputs.tag }} | ||
title: ${{ steps.previoustag.outputs.tag }} | ||
files: | | ||
README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,15 @@ | ||
# Build new docker image when a new tag is pushed, and generate changelog and release notes and use the tag as the release name. | ||
# if the tag has beta or alfa in the name, set the release as a pre-release. | ||
|
||
name: Build Release Image | ||
name: Auto create Tag and container | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
pull_request: | ||
types: | ||
- closed | ||
branches: | ||
- main | ||
|
||
# trigger workflow manually | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: "Release version (e.g. v0.0.2)" | ||
required: true | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
@@ -54,12 +44,6 @@ jobs: | |
DEFAULT_BUMP: patch | ||
# DRY_RUN: true | ||
|
||
# get the previous created tag from anothrNick/[email protected] | ||
|
||
# - name: "Get Previous tag" | ||
# id: previoustag | ||
# uses: "WyriHaximus/github-action-get-previous-tag@v1" | ||
|
||
- name: Extract version number | ||
id: extract_version | ||
run: | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters