Skip to content

Commit

Permalink
update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Babatunde50 committed Jun 9, 2024
1 parent 5c905d3 commit 3a3ec52
Showing 1 changed file with 46 additions and 13 deletions.
59 changes: 46 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ permissions:
# issues: write

jobs:
goreleaser:
runs-on: ubuntu-latest
build_chocolatey:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -24,24 +24,57 @@ jobs:
uses: actions/setup-go@v5
with:
go-version: stable
# Install Chocolatey
- name: Install Chocolatey
run: |
sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates curl gnupg lsb-release
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://packages.chocolatey.org/install.ps1 | sudo bash
# Set the CHOCOLATEY_API_KEY environment variable
Set-ExecutionPolicy Bypass -Scope Process -Force; `
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; `
iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
shell: powershell
- name: Set up environment variables
run: echo "CHOCOLATEY_API_KEY=${{ secrets.CHOCOLATEY_API_KEY }}" >> $GITHUB_ENV
# More assembly might be required: Docker logins, GPG, etc.
# It all depends on your needs.
- name: Run GoReleaser
shell: bash
- name: Run GoReleaser for Chocolatey
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: ${{ env.GITHUB_REF_NAME }}
args: release --clean --skip-publish --skip-validate --skip-sign
env:
GITHUB_TOKEN: ${{ secrets.PUBLISHER_TOKEN }}
CHOCOLATEY_API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }}

build_homebrew:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: stable
- name: Run GoReleaser for Homebrew
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: ${{ env.GITHUB_REF_NAME }}
args: release --clean --skip-publish --skip-validate --skip-sign
env:
GITHUB_TOKEN: ${{ secrets.PUBLISHER_TOKEN }}

goreleaser_publish:
runs-on: ubuntu-latest
needs: [build_chocolatey, build_homebrew]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run GoReleaser to Publish All
uses: goreleaser/goreleaser-action@v6
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
# 'latest', 'nightly', or a semver
version: ${{ env.GITHUB_REF_NAME }}
args: release --clean
env:
Expand Down

0 comments on commit 3a3ec52

Please sign in to comment.