This repository was archived by the owner on Dec 27, 2024. It is now read-only.
ADHOC: Lint the code, then format it #51
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| pull_request: | |
| paths: | |
| - .github/workflows/release.yml | |
| push: | |
| tags: | |
| - v* | |
| jobs: | |
| release: | |
| name: release | |
| runs-on: ${{ matrix.platform }} | |
| strategy: | |
| matrix: | |
| platform: | |
| - ubuntu-latest | |
| - macos-latest | |
| - windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: 1.23.4 | |
| check-latest: true | |
| - name: Setup cache | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/go/pkg/mod | |
| key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
| restore-keys: ${{ runner.os }}-go- | |
| - name: Install dependencies | |
| run: go mod tidy | |
| - name: Lint | |
| uses: golangci/golangci-lint-action@v6 | |
| with: | |
| version: v1.60 | |
| - name: Build | |
| run: make build | |
| - name: Test | |
| run: make test | |
| - name: Run (Linux and MacOS) | |
| if: ${{ runner.os != 'Windows' }} | |
| shell: bash | |
| run: | | |
| cp ./homekeeper ${{ runner.temp }} | |
| cd ${{ runner.temp }} | |
| ./homekeeper init --debug --git https://github.com/retiman/dotfiles.git | |
| - name: Run (Windows) | |
| if: ${{ runner.os == 'Windows' }} | |
| shell: pwsh | |
| run: | | |
| Copy-Item .\homekeeper.exe ${{ runner.temp }} | |
| Set-Location ${{ runner.temp }} | |
| .\homekeeper.exe init --debug --git https://github.com/retiman/dotfiles.git | |
| - name: Release | |
| if: ${{ runner.os == 'Linux' }} | |
| uses: goreleaser/goreleaser-action@v2 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| install-only: ${{ github.event_name == 'pull_request' }} | |
| distribution: goreleaser | |
| version: 1.8.3 | |
| args: release --rm-dist |