diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 6535052..78b1a21 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..f144f8b --- /dev/null +++ b/.github/workflows/release.yml @@ -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