Skip to content

Commit

Permalink
Merge pull request #4 from A2-ai/release
Browse files Browse the repository at this point in the history
setup for releasing
  • Loading branch information
dpastoor authored Dec 17, 2023
2 parents 461fce1 + 8c21ee7 commit 10e7aa4
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 3 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# .github/workflows/release.yml
name: goreleaser

on:
push:
# run only against tags
tags:
- "*"

permissions:
contents: write
# packages: write
# issues: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git fetch --force --tags
- uses: actions/setup-go@v4
with:
go-version: stable
# More assembly might be required: Docker logins, GPG, etc.
# It all depends on your needs.
- uses: goreleaser/goreleaser-action@v5
with:
# either 'goreleaser' (default) or 'goreleaser-pro':
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8 changes: 6 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ builds:
- linux
goarch:
- amd64
- arm64



Expand All @@ -26,7 +27,10 @@ nfpms:
license: "MIT"
bindir: "/opt/sortinghat"
contents:
- src: systemd/sortinghat.service
- src: ./systemd/sortinghat.service
dst: "/lib/systemd/system/sortinghat.service"
- src: systemd/sortinghat.timer
- src: ./systemd/sortinghat.timer
dst: "/lib/systemd/system/sortinghat.timer"
- src: ./systemd/config.yml
dst: /etc/sortinghat/sortinghat.yml
type: "config|noreplace"
2 changes: 2 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test-release:
goreleaser release --skip=validate --skip=publish --snapshot --clean
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@ group to allow users on Posit Connect to RunAsCurrentUser without needing to
also set up a separate unix group for them, which can be a painful approval activity
in enterprise environments.

## Installation and Activation

After installing, update either the systemd service file command to include a `--dir` flag
or update the `/etc/sortinghat/config.yml` file to include a `dir` key,
then startup the service via:

```
systemctl daemon-reload # Reload systemd to recognize the new timer
systemctl enable sortinghat.timer # Enable the timer to start on boot
systemctl start sortinghat.timer # Start the timer immediately
```

## Usage

```shell
Expand Down
7 changes: 7 additions & 0 deletions systemd/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# can set the `dir` to the directory to the directory of homedirs
# can set `allowed_groups` to as an array of groups that are allowed to get
# added
# dir: /shared/user-homes
# allowed_groups:
# - usergrp1
# - usergrp2
2 changes: 1 addition & 1 deletion systemd/sortinghat.service
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Description=Run sorting-hat

[Service]
Type=oneshot
ExecStart=/opt/sortinghat/sortinghat scan --dir=/shared
ExecStart=/opt/sortinghat/sortinghat scan

[Install]
WantedBy=multi-user.target

0 comments on commit 10e7aa4

Please sign in to comment.