Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically publish to winget & homebrew tap #441

Merged
merged 12 commits into from
Feb 15, 2024
16 changes: 16 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,23 @@ name: Cargo Build & Test

on:
push:
paths:
- .github/workflows/build.yml
- .github/workflows/release.yml
- assets/**
- src/**
- Cargo.toml
- Cargo.lock
- build.rs
pull_request:
paths:
- .github/workflows/build.yml
- .github/workflows/release.yml
- assets/**
- src/**
- Cargo.toml
- Cargo.lock
- build.rs

env:
CARGO_TERM_COLOR: always
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,3 +188,25 @@ jobs:
${{ steps.rename_binary.outputs.name }}.tar.gz
${{ steps.rename_binary.outputs.name }}.tar.gz.sha256
assets/Output/*

publish-winget:
needs: release
runs-on: ubuntu-latest
steps:
- if: ${{ github.event_name != 'workflow_run' }}
uses: vedantmgoyal2009/winget-releaser@v2
with:
identifier: RussellBanks.Komac
installers-regex: 'KomacSetup.*\.exe$'
token: ${{ secrets.WINGET_TOKEN }}

publish-homebrew-tap:
needs: release
if: ${{ github.event_name != 'workflow_run' }}
runs-on: ubuntu-latest
steps:
- name: Trigger update formula workflow (homebrew-tap)
run: gh workflow run komac.yml -f version=$($env:GITHUB_REF_NAME.TrimStart('v')) -R russellbanks/homebrew-tap
vedantmgoyal9 marked this conversation as resolved.
Show resolved Hide resolved
env:
GH_TOKEN: ${{ secrets.WINGET_TOKEN }}
shell: pwsh