Skip to content

Commit 3c94a43

Browse files
committed
Add github release actions and release
Signed-off-by: Chmouel Boudjnah <chmouel@chmouel.com>
1 parent fff2a39 commit 3c94a43

11 files changed

Lines changed: 353 additions & 0 deletions

.github/dependabot.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "cargo" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "daily"
12+
labels:
13+
- "dependencies"
14+
- package-ecosystem: "github-actions"
15+
directory: "/"
16+
schedule:
17+
interval: "weekly"
18+
labels:
19+
- "dependencies"

.github/gh-actions-with-snazy.mp4

5.14 MB
Binary file not shown.

.github/screenshot-kail.png

947 KB
Loading
478 KB
Loading

.github/screenshot.png

1.86 MB
Loading
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
on: [push]
2+
3+
name: Code Coverage
4+
5+
jobs:
6+
check:
7+
name: Rust project
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout repository
11+
uses: actions/checkout@v2
12+
13+
- name: Install stable toolchain
14+
uses: actions-rs/toolchain@v1
15+
with:
16+
toolchain: stable
17+
override: true
18+
- uses: Swatinem/rust-cache@v1
19+
20+
- name: Run cargo-tarpaulin
21+
uses: actions-rs/tarpaulin@v0.1
22+
with:
23+
version: '0.15.0'
24+
args: '-- --test-threads 1'
25+
26+
- name: Upload to codecov.io
27+
uses: codecov/codecov-action@v1.0.2
28+
with:
29+
token: ${{secrets.CODECOV_TOKEN}}
30+
31+
- name: Archive code coverage results
32+
uses: actions/upload-artifact@v1
33+
with:
34+
name: code-coverage-report
35+
path: cobertura.xml

.github/workflows/container.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Create and publish a Docker image to ghcr
2+
3+
on:
4+
push:
5+
# run only against tags
6+
tags:
7+
- '*'
8+
env:
9+
REGISTRY: ghcr.io
10+
IMAGE_NAME: ${{ github.repository }}
11+
12+
jobs:
13+
build-and-push-image:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
packages: write
18+
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v3
22+
23+
- name: Log in to the Container registry
24+
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
25+
with:
26+
registry: ${{ env.REGISTRY }}
27+
username: ${{ github.actor }}
28+
password: ${{ secrets.GITHUB_TOKEN }}
29+
30+
- name: Extract metadata (tags, labels) for Docker
31+
id: meta
32+
uses: docker/metadata-action@507c2f2dc502c992ad446e3d7a5dfbe311567a96
33+
with:
34+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
35+
36+
- name: Build and push Docker image
37+
uses: docker/build-push-action@37abcedcc1da61a57767b7588cb9d03eb57e28b3
38+
with:
39+
context: .
40+
push: true
41+
tags: ${{ steps.meta.outputs.tags }}
42+
labels: ${{ steps.meta.outputs.labels }}

.github/workflows/releaser.yaml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: goreleaser
2+
3+
on:
4+
push:
5+
# run only against tags
6+
tags:
7+
- '*'
8+
9+
permissions:
10+
contents: write
11+
# packages: write
12+
issues: write
13+
14+
jobs:
15+
build:
16+
# runs-on: ubuntu-latest
17+
name: ${{ matrix.job.os }} (${{ matrix.job.target }})
18+
runs-on: ${{ matrix.job.os }}
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
job:
23+
- {os: ubuntu-latest, target: x86_64-unknown-linux-gnu}
24+
- {os: macos-latest, target: x86_64-apple-darwin}
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v2
28+
- name: Fetch all tags
29+
run: git fetch --force --tags
30+
- uses: actions-rs/toolchain@v1
31+
with:
32+
toolchain: stable
33+
target: ${{ matrix.job.target }}
34+
- uses: Swatinem/rust-cache@v2
35+
- name: Build on ${{ matrix.job.target }}
36+
uses: actions-rs/cargo@v1
37+
with:
38+
command: build
39+
args: --release --target=${{ matrix.job.target }}
40+
41+
- uses: actions/upload-artifact@v3
42+
with:
43+
name: raffi-${{ matrix.job.target }}
44+
path: target/${{ matrix.job.target }}/release/raffi
45+
goreleaser:
46+
name: Goreleaser over Rust
47+
needs: build
48+
runs-on: ubuntu-latest
49+
steps:
50+
- name: Checkout
51+
uses: actions/checkout@v2
52+
with:
53+
fetch-depth: 0
54+
- uses: actions/download-artifact@v3
55+
with:
56+
name: raffi-x86_64-unknown-linux-gnu
57+
path: target/linux_amd64/raffi
58+
- uses: actions/download-artifact@v3
59+
with:
60+
name: raffi-x86_64-apple-darwin
61+
path: target/darwin_amd64/raffi
62+
63+
# - uses: mxschmitt/action-tmate@v3
64+
65+
- name: Run GoReleaser
66+
uses: goreleaser/goreleaser-action@v4
67+
with:
68+
distribution: goreleaser
69+
version: latest
70+
args: release --rm-dist
71+
env:
72+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73+
AUR_PRIVATE_KEY: ${{ secrets.AUR_PRIVATE_KEY }}
74+
75+
- uses: katyo/publish-crates@v2
76+
with:
77+
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}

.github/workflows/rust.yaml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
on: [push, pull_request]
2+
3+
name: Rust CI
4+
5+
jobs:
6+
check:
7+
name: Check
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout sources
11+
uses: actions/checkout@v2
12+
13+
- name: Install stable toolchain
14+
uses: actions-rs/toolchain@v1
15+
with:
16+
profile: minimal
17+
toolchain: stable
18+
override: true
19+
20+
- uses: Swatinem/rust-cache@v2
21+
22+
- name: Run cargo check
23+
uses: actions-rs/cargo@v1
24+
with:
25+
command: check
26+
27+
test:
28+
name: Test Suite
29+
runs-on: ubuntu-latest
30+
steps:
31+
- name: Checkout sources
32+
uses: actions/checkout@v2
33+
34+
- name: Install stable toolchain
35+
uses: actions-rs/toolchain@v1
36+
with:
37+
profile: minimal
38+
toolchain: stable
39+
override: true
40+
41+
- uses: Swatinem/rust-cache@v2
42+
43+
- name: Run cargo test
44+
uses: actions-rs/cargo@v1
45+
with:
46+
command: test
47+
48+
lints:
49+
name: Lints
50+
runs-on: ubuntu-latest
51+
steps:
52+
- name: Checkout sources
53+
uses: actions/checkout@v2
54+
55+
- name: Install stable toolchain
56+
uses: actions-rs/toolchain@v1
57+
with:
58+
profile: minimal
59+
toolchain: stable
60+
override: true
61+
components: rustfmt, clippy
62+
- uses: Swatinem/rust-cache@v2
63+
64+
- name: Run cargo fmt
65+
uses: actions-rs/cargo@v1
66+
with:
67+
command: fmt
68+
args: --all -- --check
69+
70+
- name: Run cargo clippy
71+
uses: actions-rs/cargo@v1
72+
with:
73+
command: clippy
74+
args: -- -D warnings

.goreleaser.yaml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
project_name: raffi
2+
builds:
3+
- main: dummy.go
4+
goos:
5+
- darwin
6+
- linux
7+
goarch:
8+
- amd64
9+
binary: raffi
10+
hooks:
11+
post: /bin/bash -c "install -m755 target/darwin_amd64/raffi/raffi dist/raffi_darwin_amd64_v1/raffi;install -m755 target/linux_amd64/raffi/raffi dist/raffi_linux_amd64_v1/raffi"
12+
archives:
13+
- replacements:
14+
darwin: macOS
15+
name_template: "{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
16+
files:
17+
- src: misc/completions/*
18+
dst: completions
19+
strip_parent: true
20+
- LICENSE
21+
- README.md
22+
checksum:
23+
name_template: "checksums.txt"
24+
25+
brews:
26+
- name: raffi
27+
tap:
28+
owner: chmouel
29+
name: raffi
30+
folder: Formula
31+
homepage: "https://github.com/chmouel/raffi"
32+
description: "raffi - wofi launcher based on yaml configuration"
33+
install: |
34+
bin.install "raffi" => "raffi"
35+
prefix.install_metafiles
36+
37+
output = Utils.popen_read("SHELL=bash #{bin}/raffi --shell-completion bash")
38+
(bash_completion/"raffi").write output
39+
40+
output = Utils.popen_read("SHELL=zsh #{bin}/raffi --shell-completion zsh")
41+
(zsh_completion/"_raffi").write output
42+
43+
output = Utils.popen_read("SHELL=fish #{bin}/raffi --shell-completion fish")
44+
(fish_completion/"raffi.fish").write output
45+
46+
nfpms:
47+
- file_name_template: "raffi-{{.Version}}_{{.Os}}-{{.Arch}}"
48+
homepage: https://github.com/chmouel/raffi
49+
description: raffi - wofi launcher based on yaml configuration
50+
maintainer: Chmouel Boudjnah <chmouel@chmouel.com>
51+
license: Apache 2.0
52+
formats:
53+
- deb
54+
- rpm
55+
bindir: /usr/bin
56+
replacements:
57+
amd64: 64bit
58+
386: 32bit
59+
arm: ARM
60+
arm64: ARM64
61+
darwin: macOS
62+
linux: Linux
63+
windows: Windows
64+
65+
changelog:
66+
sort: asc
67+
use: github
68+
filters:
69+
exclude:
70+
- "^docs:"
71+
- "^test:"
72+
- "^Brew formula update"
73+
- Merge pull request
74+
- Merge branch
75+
- go mod tidy
76+
- Update README.md
77+
- "[release] "
78+
79+
universal_binaries:
80+
- replace: true
81+
name_template: "raffi"
82+
83+
release:
84+
prerelease: "false"
85+
86+
aurs:
87+
- name: raffi-bin
88+
homepage: "https://github.com/chmouel/raffi"
89+
description: "raffi - wofi launcher based on yaml configuration"
90+
maintainers:
91+
- "Chmouel Boudjnah <chmouel@chmouel.com>"
92+
license: Apache 2.0
93+
private_key: "{{ .Env.AUR_PRIVATE_KEY }}"
94+
git_url: ssh://aur@aur.archlinux.org/raffi-bin.git
95+
package: |
96+
# bin
97+
install -Dm755 "./raffi" "${pkgdir}/usr/bin/raffi"
98+
99+
# license
100+
install -Dm644 "./LICENSE" "${pkgdir}/usr/share/licenses/raffi/LICENSE"

0 commit comments

Comments
 (0)