cli/.github/workflows/releases.yml
vilmibm 06d90d5e46 automatically produce MSI files for releases
This commit:

- Adds config for building Windows installers
- Adds an action for fetching exe files built by goreleaser
- Adds an action for building Windows installers
- Adds an action for adding MSI files to an existing GH release
- Adds MSI signing to our release flow
- Disables homebrew formula bumping for prereleases
- Allows the release asset copying action to copy windows assets
2019-12-19 15:03:03 -06:00

86 lines
2.5 KiB
YAML

name: goreleaser
on:
push:
tags:
- "v*"
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Set up Go 1.13
id: go
uses: actions/setup-go@v1
with:
go-version: 1.13
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
with:
version: latest
args: release
env:
GH_OAUTH_CLIENT_ID: 178c6fc778ccc68e1d6a
GH_OAUTH_CLIENT_SECRET: ${{secrets.OAUTH_CLIENT_SECRET}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
msi:
needs: goreleaser
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Set up Go 1.13
id: go
uses: actions/setup-go@v1
with:
go-version: 1.13
- name: Download gh.exe
uses: ./.github/actions/download-exe
id: download_exe
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Install go-msi
run: choco install -y "go-msi"
- name: Build MSI
id: buildmsi
uses: ./.github/actions/build-msi
with:
exe: ${{ steps.download_exe.outputs.exe }}
- name: Obtain signing cert
env:
DESKTOP_CERT_TOKEN: ${{ secrets.DESKTOP_CERT_TOKEN }}
run: .\setup-windows-certificate.ps1
shell: powershell
- name: Sign MSI
env:
GITHUB_CERT_PASSWORD: ${{ secrets.GITHUB_CERT_PASSWORD }}
run: .\sign.ps1 -Certificate "windows-certificate.pfx" -Executable "${{ steps.buildmsi.outputs.msi }}"
- name: Upload MSI
uses: ./.github/actions/upload-msi
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
releases:
needs: msi
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Copy release
id: copy
uses: ./.github/actions/copy-release-to-another-repo
with:
target-repo: github/homebrew-gh
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
UPLOAD_GITHUB_TOKEN: ${{secrets.UPLOAD_GITHUB_TOKEN}}
- name: Bump brew formula
if: "!contains(github.ref, '-')" # skip prereleases
uses: mislav/bump-homebrew-formula-action@v1.4
with:
formula-name: gh
homebrew-tap: github/homebrew-gh
download-url: ${{ steps.copy.outputs.asset-url }}
env:
COMMITTER_TOKEN: ${{ secrets.UPLOAD_GITHUB_TOKEN }}