Skip to content

Commit

Permalink
chore: update ci to publish deb packages
Browse files Browse the repository at this point in the history
  • Loading branch information
ybirader committed Sep 13, 2023
1 parent be133a5 commit 19c5ff3
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,24 @@ jobs:
with:
go-version: ${{ matrix.GO_SEMVER }}
check-latest: true
- name: Install Cloudsmith CLI
run: pip install --upgrade cloudsmith-cli
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
version: latest
args: release --clean --timeout 30m
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
TAG: ${{ steps.vars.outputs.version_tag }}
- name: Publish .deb to Cloudsmith
if: ${{ steps.vars.output.tag_special == '' }}
env:
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
run: |
for filename in dist/*.deb; do
echo "Pushing $filename to 'stable'"
cloudsmith push deb pzip/stable/any-distro/any-version $filename
done
2 changes: 2 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ nfpms:
- id: default
package_name: pzip
maintainer: Yusuf Birader <ybirader@users.noreply.github.com>
homepage: https://github.com/ybirader/pzip
description: |
pzip, short for parallel-zip, is a blazing fast concurrent zip archiver.
license: Apache 2.0
Expand All @@ -67,6 +68,7 @@ brews:
- name: pzip
description: "pzip, short for parallel-zip, is a blazing fast concurrent zip archiver."
license: Apache 2.0
homepage: https://github.com/ybirader/pzip
repository:
name: homebrew-pzip
owner: ybirader
18 changes: 9 additions & 9 deletions archiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,15 @@ func (a *archiver) Archive(ctx context.Context, filePaths []string) error {
return nil
}

func (a *archiver) Close() error {
err := a.w.Close()
if err != nil {
return errors.New("ERROR: could not close archiver")
}

return nil
}

func (a *archiver) archiveDir(root string) error {
err := a.changeRoot(root)
if err != nil {
Expand All @@ -149,15 +158,6 @@ func (a *archiver) archiveFile(file *pool.File) {
a.fileProcessPool.Enqueue(file)
}

func (a *archiver) Close() error {
err := a.w.Close()
if err != nil {
return errors.New("ERROR: could not close archiver")
}

return nil
}

func (a *archiver) changeRoot(root string) error {
absRoot, err := filepath.Abs(root)
if err != nil {
Expand Down

0 comments on commit 19c5ff3

Please sign in to comment.