Skip to content

Commit

Permalink
Merge branch 'main' into renovate/aqua
Browse files Browse the repository at this point in the history
  • Loading branch information
scottames authored Apr 15, 2023
2 parents 22964c1 + 3d433be commit 607c664
Show file tree
Hide file tree
Showing 6 changed files with 108 additions and 2 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@ on:
push:
branches:
- main
# yamllint disable-line rule:empty-values
pull_request:
branches:
- main
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/release_please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
on:
push:
branches:
- main
paths:
- pkg/**
- magefiles/**
- CHANGELOG.md
- go.*
permissions:
contents: write
pull-requests: write
name: release-please
jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3
with:
release-type: go
package-name: dots
17 changes: 17 additions & 0 deletions .github/workflows/semantic_pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Check Semantic Pull Request

on:
pull_request_target:
types:
- opened
- edited
- synchronize

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .trunk/trunk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ lint:
paths:
# Generated files
- "*.tmpl"
- linters: [markdownlint]
paths:
- CHANGELOG.md
runtimes:
enabled:
- [email protected]
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changelog

## 0.1.0 (2023-04-15)


### Miscellaneous Chores

* release 0.1.0 ([5c9303b](https://github.com/scottames/dots/commit/5c9303b6ad747d5df5db66057b3d964f913cd89d))
58 changes: 58 additions & 0 deletions magefiles/paru.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
package main

import (
"fmt"
"os"
"path/filepath"

"github.com/magefile/mage/mg"
"github.com/scottames/cmder"

"github.com/scottames/dots/pkg/helpers"
)

const (
sudo = "sudo"
paru = "paru"
paruGit = "https://aur.archlinux.org/paru.git"
paruHome = "https://github.com/Morganamilo/paru"
)

type Paru mg.Namespace

// About - print about.
func (Paru) About() {
fmt.Printf("\n%s\n", paruHome)
}

// Install - install paru from AUR.
func (Paru) Install() error {
var err error
tmpDir, err := os.MkdirTemp("", "paru")
if err != nil {
return fmt.Errorf("error creating temp dir: %w", err)
}
err = helpers.GitClone(paruGit, &tmpDir)
if err != nil {
return err
}
defer os.RemoveAll(tmpDir)

cloneDir := tmpDir + "/paru"
err = cmder.New("makepkg", "-s").Dir(cloneDir).Run()
if err != nil {
return err
}

pkg, err := filepath.Glob(tmpDir + "/paru*.pkg.tar.zst")
if err != nil {
return err
}
if len(pkg) == 0 {
return fmt.Errorf("unable to find %s package to install", paru)
}

fmt.Printf("\nInstalling %s...\n\n", paru)

return cmder.New(sudo, "pacman", "--noconfirm", "-U", pkg[0]).Run()
}

0 comments on commit 607c664

Please sign in to comment.