diff --git a/.github/workflows/github-release.yml b/.github/workflows/github-release.yml index d84fe51..2379cf3 100644 --- a/.github/workflows/github-release.yml +++ b/.github/workflows/github-release.yml @@ -17,8 +17,10 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 + - name: install autotag binary run: curl -sL https://git.io/autotag-install | sudo sh -s -- -b /usr/bin + - name: create release run: |- TAG=$(autotag) diff --git a/.github/workflows/goreleaser.yml b/.github/workflows/goreleaser.yml index c209e0b..6d4b6ff 100644 --- a/.github/workflows/goreleaser.yml +++ b/.github/workflows/goreleaser.yml @@ -11,23 +11,21 @@ permissions: jobs: goreleaser: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - - - name: Checkout - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: fetch-depth: 0 - - - name: Set up Go - uses: actions/setup-go@v3 - - - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v4 + + - name: Set up Go + uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5 + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6 with: distribution: goreleaser version: latest args: release --clean env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - + GITHUB_TOKEN: ${{ secrets.GH_PAT }} diff --git a/.github/workflows/lint-test.yml b/.github/workflows/lint-test.yml index f60f2ab..48b869e 100644 --- a/.github/workflows/lint-test.yml +++ b/.github/workflows/lint-test.yml @@ -5,17 +5,22 @@ permissions: jobs: lint-test: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v4 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + with: + fetch-depth: 0 + + - name: Set up Go + uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5 + - name: golangci-lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@971e284b6050e8a5849b72094c50ab08da042db8 # v6 with: - version: v1.54 + version: latest + - name: Install dependencies run: go get . - - name: Build - run: go build -v ./... + - name: Test with the Go CLI run: go test -v ./... diff --git a/.github/workflows/validate-renovate.yml b/.github/workflows/validate-renovate.yml new file mode 100644 index 0000000..81aeece --- /dev/null +++ b/.github/workflows/validate-renovate.yml @@ -0,0 +1,21 @@ +name: validate renovate.json5 + +on: + pull_request: + +env: + LOG_LEVEL: debug + +jobs: + renovate-config-validator: + runs-on: ubuntu-latest + timeout-minutes: 10 + + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + + - uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4 + with: + node-version: 20 + + - run: npx -p renovate renovate-config-validator renovate.json5 diff --git a/.golangci.yml b/.golangci.yml index 55550f7..b4e59df 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,4 +1,6 @@ linters: enable: - gofmt - +issues: + exclude-dirs: + - ../../go diff --git a/.goreleaser.yml b/.goreleaser.yml index 663a270..2e42174 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -1,3 +1,4 @@ +version: 2 before: hooks: - go mod tidy @@ -36,11 +37,10 @@ changelog: - '^test:' brews: - name: papercut - homepage: "https://github.com/lehigh-university-libraries/homebrew-papercut" - tap: - owner: lehigh-university-libraries - name: homebrew-papercut + homepage: "https://github.com/lehigh-university-libraries/papercut" commit_author: name: joecorall email: jjc223@lehigh.edu - + repository: + owner: lehigh-university-libraries + name: homebrew diff --git a/README.md b/README.md index 589d1be..d56e976 100644 --- a/README.md +++ b/README.md @@ -9,13 +9,13 @@ Command line utility to help fetch scholarly articles from various sources. You can install papercut using homebrew ``` -brew tap lehigh-university-libraries/papercut -brew install papercut +brew tap lehigh-university-libraries/homebrew https://github.com/lehigh-university-libraries/homebrew +brew install lehigh-university-libraries/homebrew/papercut ``` ### Download Binary -Instead of homebrew, you can download a binary for your system from [the latest release](https://github.com/lehigh-university-libraries/homebrew-papercut/releases/latest) +Instead of homebrew, you can download a binary for your system from [the latest release](https://github.com/lehigh-university-libraries/papercut/releases/latest) Then put the binary in a directory that is in your `$PATH` @@ -115,8 +115,8 @@ If the binary was downloaded and added to the `$PATH` updating papercut could lo ``` # update for your architecture ARCH="papercut_Linux_x86_64.tar.gz" -TAG=$(gh release list --exclude-pre-releases --exclude-drafts --limit 1 --repo lehigh-university-libraries/homebrew-papercut | awk '{print $3}') -gh release download $TAG --repo lehigh-university-libraries/homebrew-papercut --pattern $ARCH +TAG=$(gh release list --exclude-pre-releases --exclude-drafts --limit 1 --repo lehigh-university-libraries/papercut | awk '{print $3}') +gh release download $TAG --repo lehigh-university-libraries/papercut --pattern $ARCH tar -zxvf $ARCH mv papercut /directory/in/path/binary/was/placed rm $ARCH diff --git a/go.mod b/go.mod index 4a2206b..470c29d 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/lehigh-university-libraries/papercut -go 1.20 +go 1.23.4 require github.com/spf13/cobra v1.7.0 diff --git a/papercut.rb b/papercut.rb deleted file mode 100644 index d4e695e..0000000 --- a/papercut.rb +++ /dev/null @@ -1,47 +0,0 @@ -# typed: false -# frozen_string_literal: true - -# This file was generated by GoReleaser. DO NOT EDIT. -class Papercut < Formula - desc "" - homepage "https://github.com/lehigh-university-libraries/homebrew-papercut" - version "0.4.1" - - on_macos do - if Hardware::CPU.intel? - url "https://github.com/lehigh-university-libraries/homebrew-papercut/releases/download/0.4.1/homebrew-papercut_Darwin_x86_64.tar.gz" - sha256 "b452248c432d79d1dfdc689e5161d5025b5c800e5d29e4529653a89717d5a718" - - def install - bin.install "papercut" - end - end - if Hardware::CPU.arm? - url "https://github.com/lehigh-university-libraries/homebrew-papercut/releases/download/0.4.1/homebrew-papercut_Darwin_arm64.tar.gz" - sha256 "62c083357e23ed03250b32b0ba4f609e39e8f63b7f799d8e473b56942c65e021" - - def install - bin.install "papercut" - end - end - end - - on_linux do - if Hardware::CPU.intel? - url "https://github.com/lehigh-university-libraries/homebrew-papercut/releases/download/0.4.1/homebrew-papercut_Linux_x86_64.tar.gz" - sha256 "0495e5d2794a06286404d7c3f1291fdb2dcfa9a9759359c7d341a4e635e6cd80" - - def install - bin.install "papercut" - end - end - if Hardware::CPU.arm? && Hardware::CPU.is_64_bit? - url "https://github.com/lehigh-university-libraries/homebrew-papercut/releases/download/0.4.1/homebrew-papercut_Linux_arm64.tar.gz" - sha256 "2f26de70ce6d4b7720ee0398bc64cf52f6585bc740ab1a41fd2b5ca027d5e55e" - - def install - bin.install "papercut" - end - end - end -end diff --git a/renovate.json5 b/renovate.json5 new file mode 100644 index 0000000..09a99de --- /dev/null +++ b/renovate.json5 @@ -0,0 +1,42 @@ +{ + extends: [ + 'config:best-practices', + ':rebaseStalePrs', + ], + packageRules: [ + { + matchUpdateTypes: [ + 'minor', + 'patch', + 'digest', + ], + groupName: 'bump-dependencies', + schedule: [ + 'after 10pm on Friday', + ], + matchPackageNames: [ + '*', + ], + }, + { + matchUpdateTypes: [ + 'major', + ], + groupName: 'all major updates', + schedule: [ + 'after 10pm on the first day of the month', + ], + matchPackageNames: [ + '*', + ], + }, + ], + labels: [ + 'dependencies', + ], + osvVulnerabilityAlerts: true, + dependencyDashboardOSVVulnerabilitySummary: 'unresolved', + vulnerabilityAlerts: { + enabled: true, + }, +}