Skip to content

Commit

Permalink
Add release workflow (#80)
Browse files Browse the repository at this point in the history
* Add release workflow

This kicks of a "release" whenever a release-* tag is pushed.

Signed-off-by: Miek Gieben <[email protected]>

* dont delete older releases

Signed-off-by: Miek Gieben <[email protected]>
  • Loading branch information
miekg authored Jan 30, 2021
1 parent 74d92fd commit e68d8bc
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
run: |
sudo apt update
sudo apt install libsystemd-dev
- name: Get dependencies
run: |
go get golang.org/x/lint/golint
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
on:
push:
tags:
- 'release-*' # Push of a release-* tag

name: Create Release

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

- name: Install systemd lib dependencies
run: |
sudo apt install libsystemd-dev
- name: Checkout code
uses: actions/checkout@v2

- name: systemk Build
run: go build -v ./...

- name: Get Epoch SHA
run: echo "EPOCH=`date '+%s'`" >> $GITHUB_ENV

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

- name: 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: ./systemk
asset_name: systemk
asset_content_type: application/octet-stream

0 comments on commit e68d8bc

Please sign in to comment.