Skip to content

Commit

Permalink
ci(publish): (wip) impl choco push in publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
rami3l committed Jul 19, 2023
1 parent f6fb57d commit 6b0d298
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 23 deletions.
14 changes: 13 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,20 @@ jobs:
with:
distribution: goreleaser
version: latest
args: release --clean --debug
args: release --debug
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAP_GITHUB_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }}
CHOCO_API_KEY: ${{ secrets.CHOCO_API_KEY }}

# https://github.com/goreleaser/goreleaser/blob/2a3009757a8996cdcf2a77deb0e5fa413d1f2660/internal/pipe/chocolatey/chocolatey.go#L158
- name: Inspect generated artifacts
run: |
ls -laR dist/
cat dist/pacaptr.choco/pacaptr.nuspec
# https://github.com/goreleaser/goreleaser/blob/2a3009757a8996cdcf2a77deb0e5fa413d1f2660/internal/pipe/chocolatey/chocolatey.go#L201-L208
# https://stackoverflow.com/a/75835172
- name: Publish app on Chocolatey
run: |
choco push dist/*.nupkg --source https://push.chocolatey.org --api-key ${{ secrets.CHOCO_API_KEY }} --verbose ${{ contains(github.ref, '-') && '--noop' || '' }}
28 changes: 6 additions & 22 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,7 @@ brews:
test: |
system "#{bin}/pacaptr --help"
# TODO: Remove this when moving out of testing.
# skip_upload: auto
skip_upload: false
skip_upload: auto

# https://github.com/goreleaser/goreleaser/blob/a0f0d01a8143913cde72ebc1248abef089ae9b27/.goreleaser.yaml#L211
repository:
Expand All @@ -80,7 +78,8 @@ brews:
branch: master

chocolateys:
- package_source_url: https://github.com/rami3l/pacaptr
- name: pacaptr
package_source_url: https://github.com/rami3l/pacaptr
owners: Rami3L

# == SOFTWARE SPECIFIC SECTION ==
Expand All @@ -94,6 +93,7 @@ chocolateys:
bug_tracker_url: https://github.com/rami3l/pacaptr/issues
tags: pacaptr pacman
summary: Pacman-like syntax wrapper for many package managers.
release_notes: "https://github.com/rami3l/pacaptr/releases/tag/v{{ .Version }}"
description: |
# pacaptr
Expand All @@ -102,23 +102,7 @@ chocolateys:
Run `pacaptr -Syu` on the OS of your choice!
# == PUBLISH SPECIFIC SECTION ==
source_repo: "https://push.chocolatey.org/"
api_key: "{{ .Env.CHOCO_API_KEY }}"
# TODO: Publish the nupkg release if not prerelease.
# println!(":: Setting choco API key...");
# let choco_api_key = env::var("CHOCO_API_KEY")?;
# cmd!(
# s,
# "choco apikey --key {choco_api_key} --source https://push.chocolatey.org --verbose"
# )
# .run()?;

# println!(":: Packing up NuGet package...");
# cmd!(s, "choco pack {nuspec_path} --verbose").run()?;

# println!(":: Pushing to choco repository...");
# cmd!(
# s,
# "choco push pacaptr.{ver}.nupkg --source https://push.chocolatey.org --verbose"
# )
# .run()?;
# Publishing is handled in `.github\workflows\publish.yml`.
skip_publish: true
Binary file added assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6b0d298

Please sign in to comment.