Skip to content

Commit

Permalink
new release workflow (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
sfertman committed Oct 24, 2020
1 parent de46351 commit 99e616a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
33 changes: 24 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,47 @@
name: Create Release

on:
push:
tags:
- 'v*'
# branches:
# - master

name: Create Release
branches:
- master

jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v2
with:
fetch-depth: 1

- name: Get DN Version
run: echo "DN_VERSION=$(. dn.sh -v)" >> $GITHUB_ENV

- name: Get IS_PRERELEASE
run: echo "IS_PRERELEASE=$(echo ${{ env.DN_VERSION }} | grep -q '\-SNAPSHOT$' && echo true || echo false)" >> $GITHUB_ENV

- name: Delete snapshot release (if exists)
run: echo ${{env.DN_VERSION}} | grep -q '\-SNAPSHOT$' && gh release delete ${{ env.DN_VERSION }} -y
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Delete snapshot tag (if exists)
run: echo ${{ env.DN_VERSION }} | grep -q '\-SNAPSHOT$' && git push --delete origin ${{ env.DN_VERSION }}
continue-on-error: true

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ env.DN_VERSION }}
release_name: v${{ env.DN_VERSION }}
tag_name: ${{ env.DN_VERSION }}
release_name: ${{ env.DN_VERSION }}
draft: false
prerelease: false
prerelease: ${{env.IS_PRERELEASE}}

- name: Upload a Release Asset
uses: actions/upload-release-asset@v1.0.2
env:
Expand Down
2 changes: 1 addition & 1 deletion dn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -e
## useful resource: https://hackernoon.com/inspecting-docker-images-without-pulling-them-4de53d34a604
# "inspecting docker image without pulling"

DN_VERSION=0.4.0
DN_VERSION='0.4.1-SNAPSHOT'
DN_REPO_URL='https://github.com/sfertman/dn'

DN_PREFIX=/usr/local
Expand Down

0 comments on commit 99e616a

Please sign in to comment.