diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 00000000..580eab63 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,67 @@ +name: release +on: + workflow_dispatch: + inputs: + version: + description: Version + required: true + +jobs: + build: + runs-on: ubuntu-latest + steps: + + - name: checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: shellcheck + uses: ludeeus/action-shellcheck@1.0.0 + + - name: Setup go + uses: actions/setup-go@v2 + with: + go-version: 1.14 + + - name: Install tools + run: | + ./setup.sh + + - name: Lint + run: | + go vet -v ./... + goimports -w -l . + go mod tidy + git diff --exit-code + + - name: Login to registry + uses: docker/login-action@v1 + with: + registry: quay.io + username: ${{ secrets.QUAY_USERNAME }} + password: ${{ secrets.QUAY_PASSWORD }} + + - name: Tag + uses: mathieudutour/github-tag-action@v4.6 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + custom_tag: ${{ github.event.inputs.version }} + + - name: Build + run: | + set -o nounset + set -o pipefail + + echo "Building release ${{ github.event.inputs.version }}" + ./build.sh --release + + - name: Create GitHub 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: false