From b825bc5844684f347e28d7bbef14bdde7a2fde99 Mon Sep 17 00:00:00 2001 From: kekskurse Date: Mon, 30 Oct 2023 11:12:50 +0100 Subject: [PATCH] add ci --- .forgejo/workflows/dev.yml | 19 +++++++++++++++ .forgejo/workflows/release.yml | 30 +++++++++++++++++++++++ .gitignore | 4 +++- .goreleaser.yaml | 44 ++++++++++++++++++++++++++++++++++ 4 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 .forgejo/workflows/dev.yml create mode 100644 .forgejo/workflows/release.yml create mode 100644 .goreleaser.yaml diff --git a/.forgejo/workflows/dev.yml b/.forgejo/workflows/dev.yml new file mode 100644 index 0000000..e3772a1 --- /dev/null +++ b/.forgejo/workflows/dev.yml @@ -0,0 +1,19 @@ +name: Dev Version +run-name: ${{ github.actor }} is testing +on: ["push"] +jobs: + Release: + runs-on: docker + #container: + # image: goreleaser/goreleaser + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + #- run: goreleaser release --skip-publish --snapshot --rm-dist --debug + - name: Setup Go environment + uses: https://github.com/actions/setup-go@v2.1.3 + with: + go-version: 1.21 + - name: Test + run: go test ./... \ No newline at end of file diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml new file mode 100644 index 0000000..c6a4725 --- /dev/null +++ b/.forgejo/workflows/release.yml @@ -0,0 +1,30 @@ +name: Dev Version +run-name: ${{ github.actor }} is testing +on: + push: + tags: + - '*' +jobs: + Release: + runs-on: docker + #container: + # image: goreleaser/goreleaser + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + #- run: goreleaser release --skip-publish --snapshot --rm-dist --debug + - name: Setup Go environment + uses: actions/setup-go@v4 + with: + go-version: 1.21 + - name: Run GoReleaser + uses: https://github.com/goreleaser/goreleaser-action@v4 + with: + # either 'goreleaser' (default) or 'goreleaser-pro' + distribution: goreleaser + version: latest + args: release --clean + env: + GITEA_TOKEN: ${{ secrets.TOKEN }} + GORELEASER_FORCE_TOKEN: "gitea" \ No newline at end of file diff --git a/.gitignore b/.gitignore index c0c0d94..cd2b6d9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ .idea/ -config.yml \ No newline at end of file +config.yml +idun +dist/ diff --git a/.goreleaser.yaml b/.goreleaser.yaml new file mode 100644 index 0000000..1e40ac2 --- /dev/null +++ b/.goreleaser.yaml @@ -0,0 +1,44 @@ +# This is an example .goreleaser.yml file with some sensible defaults. +# Make sure to check the documentation at https://goreleaser.com +before: + hooks: + # You may remove this if you don't use go modules. + #- go mod tidy + # you may remove this if you don't need go generate + #- go generate ./... +builds: + - env: + - CGO_ENABLED=0 + goos: + - linux + - darwin + +archives: + - format: tar.gz + # this name template makes the OS and Arch compatible with the results of uname. + 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 }} + # use zip for windows archives + format_overrides: + - goos: windows + format: zip +checksum: + name_template: 'checksums.txt' +snapshot: + name_template: "{{ incpatch .Version }}-next" +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