Skip to content

Commit

Permalink
feat(publish): make auto PRs to tap when publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
rami3l committed Mar 2, 2021
1 parent 6ebc515 commit f3746cc
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 15 deletions.
46 changes: 33 additions & 13 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,29 +42,49 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: cargo xtask publish

bump-tap-version:
name: Bump formula version for homebrew
bump-choco-version:
name: Publish app on Chocolatey
runs-on: windows-latest
needs: [publish]
runs-on: ubuntu-latest
if: ${{ !contains(github.ref, '-') }}

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Generate new formula

- name: Publish to choco
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: cargo xtask bump-tap
CHOCO_API_KEY: ${{ secrets.CHOCO_API_KEY }}
run: cargo xtask bump-choco

bump-choco-version:
name: Publish app on Chocolatey
runs-on: windows-latest
bump-tap-version:
name: Bump formula version for homebrew
needs: [publish]
if: ${{ !contains(github.ref, '-') }}
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Generate new formula

- name: Generate new formula as `pacaptr.rb`
env:
CHOCO_API_KEY: ${{ secrets.CHOCO_API_KEY }}
run: cargo xtask bump-choco
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: cargo xtask bump-tap

- name: Checkout tap
uses: actions/checkout@v2
with:
token: ${{ secrets.GH_ACTIONS_TOKEN }}
repository: rami3l/homebrew-tap
path: homebrew-tap

- name: Overwrite formula
run: |
cp ./pacaptr.rb homebrew-tap/pacaptr.rb
ls homebrew-tap
- name: Create Pull Request
uses: peter-evans/create-pull-request@v2
with:
path: homebrew-tap
token: ${{ secrets.GH_ACTIONS_TOKEN }}
4 changes: 2 additions & 2 deletions xtask/src/dispatch/bump_tap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ impl Runner for BumpTap {
homepage = HOMEPAGE,
tag = version
);
let url_mac: String = format!("{prefix}/{bin}", prefix = url_prefix, bin = ARCHIVE_MAC);
let url_linux: String = format!("{prefix}/{bin}", prefix = url_prefix, bin = ARCHIVE_LINUX);
let url_mac = format!("{prefix}/{bin}", prefix = url_prefix, bin = ARCHIVE_MAC);
let url_linux = format!("{prefix}/{bin}", prefix = url_prefix, bin = ARCHIVE_LINUX);

println!(":: Getting checksums...");
let sha256_mac = cmd!("curl -L {url_mac}.sha256").read()?;
Expand Down

0 comments on commit f3746cc

Please sign in to comment.