Skip to content

Commit

Permalink
migrate to github
Browse files Browse the repository at this point in the history
  • Loading branch information
aine-etke committed Aug 11, 2024
1 parent d6a2bd6 commit 527c87c
Show file tree
Hide file tree
Showing 10 changed files with 81 additions and 64 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: CI (main and tags)
on:
push:
branches: [ "main" ]
tags: [ "v*" ]
permissions:
checks: write
contents: write
packages: write
pull-requests: read
jobs:
lint-test:
name: Lint and Test
runs-on: ubuntu-latest
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
- name: add just repo
run: |
wget -qO - 'https://proget.makedeb.org/debian-feeds/prebuilt-mpr.pub' | gpg --dearmor | sudo tee /usr/share/keyrings/prebuilt-mpr-archive-keyring.gpg 1> /dev/null
echo "deb [arch=all,$(dpkg --print-architecture) signed-by=/usr/share/keyrings/prebuilt-mpr-archive-keyring.gpg] https://proget.makedeb.org prebuilt-mpr $(lsb_release -cs)" | sudo tee /etc/apt/sources.list.d/prebuilt-mpr.list
- uses: ConorMacBride/install-package@v1
with:
apt: just
- name: lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
- name: test
run: just test

build-release:
name: Build and Release
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/tags/') }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
- name: Release
uses: goreleaser/goreleaser-action@v6
with:
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

24 changes: 0 additions & 24 deletions .gitlab-ci.yml

This file was deleted.

39 changes: 15 additions & 24 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,53 +1,44 @@
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

version: 2

before:
hooks:
- go mod tidy

builds:
- env:
- CGO_ENABLED=0
ldflags:
- -extldflags "-static"
flags:
- -tags=timetzdata,goolm
main: ./cmd/agru
binary: agru
main: ./cmd/
goos:
- linux
- windows
- darwin
goarch:
- amd64
- arm64
nfpms:
- vendor: https://etke.cc
package_name: agru
maintainer: etke.cc
description: A.G.R.U. stands for ansible-galaxy requirements updater
homepage: https://gitlab.com/etke.cc/tools/agru
license: GPL-3.0
formats:
- deb
- rpm
- apk
file_name_template: "{{ .PackageName }}-{{ .Version }}_{{ .Os }}-{{ .Arch }}"

archives:
- format: binary
- format: tar.gz
name_template: >-
{{ .ProjectName }}_
{{- title .Os }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else if eq .Arch "386" }}i386
{{- else }}{{ .Arch }}{{ end }}
{{- if .Arm }}v{{ .Arm }}{{ end }}
checksum:
disable: true
format_overrides:
- goos: windows
format: zip

changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'

# The lines beneath this are called `modelines`. See `:help modeline`
# Feel free to remove those if you don't want/use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
- "^docs:"
- "^test:"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ Ansible Galaxy API is not used at all, thus no API-related actions are supported
### Binaries and distro-specific packages
[Releases page](https://gitlab.com/etke.cc/tools/agru/-/releases) and [Arch Linux AUR](https://aur.archlinux.org/packages/agru)
[Releases page](https://github.com/etkecc/agru/releases) and [Arch Linux AUR](https://aur.archlinux.org/packages/agru)
### Build yourself
Expand Down
4 changes: 2 additions & 2 deletions cmd/agru/main.go → cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"os"
"path"

"gitlab.com/etke.cc/int/agru/internal/parser"
"gitlab.com/etke.cc/int/agru/internal/utils"
"github.com/etkecc/agru/internal/parser"
"github.com/etkecc/agru/internal/utils"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module gitlab.com/etke.cc/int/agru
module github.com/etkecc/agru

go 1.22

Expand Down
3 changes: 2 additions & 1 deletion internal/models/entries.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import (
"strings"
"time"

"gitlab.com/etke.cc/int/agru/internal/utils"
"gopkg.in/yaml.v3"

"github.com/etkecc/agru/internal/utils"
)

// GalaxyInstallInfo is meta/.galaxy_install_info struct
Expand Down
4 changes: 2 additions & 2 deletions internal/parser/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (

"gopkg.in/yaml.v3"

"gitlab.com/etke.cc/int/agru/internal/models"
"gitlab.com/etke.cc/int/agru/internal/utils"
"github.com/etkecc/agru/internal/models"
"github.com/etkecc/agru/internal/utils"
)

// ParseFile parses requirements.yml file
Expand Down
4 changes: 2 additions & 2 deletions internal/parser/roles.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"strings"
"sync"

"gitlab.com/etke.cc/int/agru/internal/models"
"gitlab.com/etke.cc/int/agru/internal/utils"
"github.com/etkecc/agru/internal/models"
"github.com/etkecc/agru/internal/utils"
)

var ignoredVersions = map[string]bool{
Expand Down
14 changes: 7 additions & 7 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,10 @@ default:

# update go deps
update *flags:
go get {{ flags }} ./cmd/agru
go get {{ flags }} ./cmd
go mod tidy
go mod vendor

# install app
install:
go install ./cmd/agru

# run linter
lint:
golangci-lint run ./...
Expand All @@ -20,6 +16,10 @@ lint:
lintfix:
golangci-lint run --fix ./...

# generate mocks
mocks:
@mockery --all --inpackage --testonly --exclude vendor

# run unit tests
test packages="./...":
@go test -cover -coverprofile=cover.out -coverpkg={{ packages }} -covermode=set {{ packages }}
Expand All @@ -28,8 +28,8 @@ test packages="./...":

# run app
run:
@go run ./cmd/agru
@go run ./cmd

# build app
build:
CGO_ENABLED=0 go build -ldflags '-extldflags "-static"' -tags timetzdata,goolm -v -o agru ./cmd/agru
CGO_ENABLED=0 go build -ldflags '-extldflags "-static"' -tags timetzdata,goolm -v -o agru ./cmd

0 comments on commit 527c87c

Please sign in to comment.