- Allow .msi file to be specified via input to action - Delete obsolete .exe file after uploading .msi
90 lines
2.7 KiB
YAML
90 lines
2.7 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
|
|
uses: actions/setup-go@v1
|
|
with:
|
|
go-version: 1.13
|
|
- name: Generate changelog
|
|
run: script/changelog | tee CHANGELOG.md
|
|
- name: Run GoReleaser
|
|
uses: goreleaser/goreleaser-action@v1
|
|
with:
|
|
version: latest
|
|
args: release --release-notes=CHANGELOG.md
|
|
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
|
|
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
|
|
id: obtain_cert
|
|
env:
|
|
DESKTOP_CERT_TOKEN: ${{ secrets.DESKTOP_CERT_TOKEN }}
|
|
run: .\script\setup-windows-certificate.ps1
|
|
- name: Sign MSI
|
|
env:
|
|
GITHUB_CERT_PASSWORD: ${{ secrets.GITHUB_CERT_PASSWORD }}
|
|
run: |
|
|
.\script\sign.ps1 -Certificate "${{ steps.obtain_cert.outputs.cert-file }}" `
|
|
-Executable "${{ steps.buildmsi.outputs.msi }}"
|
|
- name: Upload MSI
|
|
uses: ./.github/actions/upload-msi
|
|
with:
|
|
msi-file: ${{ steps.buildmsi.outputs.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 }}
|