2021-02-18 20:38:32 +00:00
|
|
|
name: Create Release & Upload Assets
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
# Sequence of patterns matched against refs/tags
|
|
|
|
tags:
|
|
|
|
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
|
|
|
|
|
|
|
|
jobs:
|
2021-02-18 22:28:17 +00:00
|
|
|
test:
|
2021-02-18 20:38:32 +00:00
|
|
|
name: Lint, Test, Build
|
2021-02-23 05:05:24 +00:00
|
|
|
runs-on: ubuntu-20.04
|
2021-02-18 21:55:50 +00:00
|
|
|
outputs:
|
|
|
|
is_prerelease: ${{ steps.is_prerelease.outputs.IS_PRERELEASE }}
|
2021-02-18 20:38:32 +00:00
|
|
|
steps:
|
2021-02-18 21:55:50 +00:00
|
|
|
-
|
|
|
|
name: Checkout
|
2021-02-18 20:38:32 +00:00
|
|
|
uses: actions/checkout@v2
|
2021-02-18 21:55:50 +00:00
|
|
|
-
|
|
|
|
name: Setup Go
|
2021-02-18 20:38:32 +00:00
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
2021-03-02 22:27:02 +00:00
|
|
|
go-version: '1.15.8'
|
2021-02-18 21:55:50 +00:00
|
|
|
-
|
|
|
|
name: Install Deps
|
2021-02-18 21:09:27 +00:00
|
|
|
id: install-deps
|
|
|
|
run: sudo apt-get -y install libpcsclite-dev
|
2021-02-18 21:55:50 +00:00
|
|
|
-
|
|
|
|
name: Lint, Test, Build
|
2021-02-18 22:28:17 +00:00
|
|
|
id: lint_test_build
|
2021-02-19 03:13:09 +00:00
|
|
|
run: V=1 make -j1 bootstrap ci
|
2021-02-18 20:38:32 +00:00
|
|
|
|
2021-02-23 05:05:24 +00:00
|
|
|
create_release:
|
|
|
|
name: Create Release
|
2021-02-18 22:28:17 +00:00
|
|
|
needs: test
|
2021-02-23 05:05:24 +00:00
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
outputs:
|
|
|
|
is_prerelease: ${{ steps.is_prerelease.outputs.IS_PRERELEASE }}
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Is Pre-release
|
|
|
|
id: is_prerelease
|
|
|
|
run: |
|
|
|
|
set +e
|
|
|
|
echo ${{ github.ref }} | grep "\-rc.*"
|
|
|
|
OUT=$?
|
|
|
|
if [ $OUT -eq 0 ]; then IS_PRERELEASE=true; else IS_PRERELEASE=false; fi
|
|
|
|
echo "::set-output name=IS_PRERELEASE::${IS_PRERELEASE}"
|
|
|
|
-
|
|
|
|
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: ${{ steps.is_prerelease.outputs.IS_PRERELEASE }}
|
|
|
|
|
|
|
|
goreleaser:
|
2021-02-23 05:25:40 +00:00
|
|
|
name: Upload Assets To Github w/ goreleaser
|
2021-02-23 05:05:24 +00:00
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
needs: create_release
|
2021-02-18 20:38:32 +00:00
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
-
|
|
|
|
name: Set up Go
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
|
|
|
go-version: 1.16
|
|
|
|
-
|
|
|
|
name: Run GoReleaser
|
|
|
|
uses: goreleaser/goreleaser-action@56f5b77f7fa4a8fe068bf22b732ec036cc9bc13f # v2.4.1
|
|
|
|
with:
|
|
|
|
version: latest
|
|
|
|
args: release --rm-dist
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.PAT }}
|
|
|
|
|
2021-02-23 05:05:24 +00:00
|
|
|
release_deb:
|
2021-02-23 05:25:40 +00:00
|
|
|
name: Build & Upload Debian Package To Github
|
2021-02-23 05:05:24 +00:00
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
needs: create_release
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
-
|
|
|
|
name: Set up Go
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
2021-03-02 22:27:02 +00:00
|
|
|
go-version: '1.15.8'
|
2021-02-23 05:05:24 +00:00
|
|
|
-
|
|
|
|
name: APT Install
|
|
|
|
id: aptInstall
|
|
|
|
run: sudo apt-get -y install build-essential debhelper fakeroot
|
|
|
|
-
|
|
|
|
name: Build Debian package
|
|
|
|
id: build
|
|
|
|
run: |
|
|
|
|
PATH=$PATH:/usr/local/go/bin:/home/admin/go/bin
|
|
|
|
make debian
|
|
|
|
-
|
|
|
|
name: Upload Debian Package
|
|
|
|
id: upload_deb
|
|
|
|
run: |
|
|
|
|
tag_name="${GITHUB_REF##*/}"
|
|
|
|
hub release edit $(find ./.releases -type f -printf "-a %p ") -m "" "$tag_name"
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
|
2021-02-18 22:28:17 +00:00
|
|
|
build_upload_docker:
|
|
|
|
name: Build & Upload Docker Images
|
2021-02-23 05:05:24 +00:00
|
|
|
runs-on: ubuntu-20.04
|
2021-02-18 22:44:05 +00:00
|
|
|
needs: test
|
2021-02-18 22:28:17 +00:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Setup Go
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
2021-03-02 22:27:02 +00:00
|
|
|
go-version: '1.15.8'
|
2021-02-18 22:28:17 +00:00
|
|
|
- name: Build
|
|
|
|
id: build
|
|
|
|
run: |
|
|
|
|
PATH=$PATH:/usr/local/go/bin:/home/admin/go/bin
|
|
|
|
make docker-artifacts
|
|
|
|
env:
|
|
|
|
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
|
|
|
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|