Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/unstable' into unstable
Browse files Browse the repository at this point in the history
  • Loading branch information
davidnewhall committed Aug 2, 2024
2 parents 7402c23 + 37c3066 commit 8e44546
Show file tree
Hide file tree
Showing 303 changed files with 4,033 additions and 26,577 deletions.
25 changes: 5 additions & 20 deletions .github/workflows/codetests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ jobs:
- name: go-generate
run: GOOS=darwin go generate ./...
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
uses: golangci/golangci-lint-action@v6
with:
version: 'v1.56'
version: v1.59
args: --build-tags nodbus

golangci-linux:
# description: "Runs golangci-lint on linux against linux and windows."
Expand All @@ -69,22 +70,6 @@ jobs:
- name: go-generate
run: GOOS=linux go generate ./...
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
uses: golangci/golangci-lint-action@v6
with:
version: 'v1.56'

homebrew-test:
# description: "Installs dependencies on macOS and runs `make install` to mimic a homebrew install."
name: test-homebrew-install
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: go-generate
run: go generate ./...
- name: make-install
run: |
TMP=$(mktemp -d)
make install VERSION=0.0.1 ITERATION=240 PREFIX=$TMP ETC=$TMP/etc
version: v1.59
24 changes: 17 additions & 7 deletions .github/workflows/ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4

with:
# we need the whole thing so we can count commits.
fetch-depth: '0'
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
Expand All @@ -44,9 +46,14 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set docker build-args
env:
SLIPPERS: ${{ secrets.SLIPPERS }}
run: >-
git fetch --force --tags;
source ./settings.sh;
[ -z SLIPPERS ] || eval "${SLIPPERS}";
gzip -9 pkg/bindata/files/{css,js}/*;
gzip -9r pkg/bindata/templates/*;
for item in DATE COMMIT VERSION ITERATION BRANCH LICENSE DESC VENDOR MAINT SOURCE_URL; do
eval echo "settings.sh build-arg: ${item}=\$${item}";
eval echo "${item}=\$${item}" >> $GITHUB_ENV;
Expand All @@ -59,17 +66,20 @@ jobs:
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
flavor: latest=false
tags: |
type=semver,pattern=v{{version}}${{ matrix.docker.sfx }}
type=semver,pattern={{version}}${{ matrix.docker.sfx }}
type=semver,pattern={{major}}.{{minor}}${{ matrix.docker.sfx }}
type=semver,pattern={{major}}${{ matrix.docker.sfx }}
type=semver,priority=1010,pattern=latest,enable=${{ matrix.docker.sfx == '' }}
type=semver,priority=1010,pattern=${{ matrix.docker.name }},enable=${{ matrix.docker.sfx != '' }}
type=semver,priority=1009,pattern={{major}}${{ matrix.docker.sfx }}
type=semver,priority=1008,pattern={{major}}.{{minor}}${{ matrix.docker.sfx }}
type=semver,priority=1007,pattern={{version}}${{ matrix.docker.sfx }}
type=semver,priority=1006,pattern=v{{version}}${{ matrix.docker.sfx }}
type=ref,enable=true,event=branch,suffix=${{ matrix.docker.sfx }}
# Build and push Docker image with Buildx
# https://github.com/docker/build-push-action
- name: Build and push ${{ matrix.docker.name }} Docker image
uses: docker/build-push-action@v5
- name: Build v${{ env.VERSION }}-${{ env.ITERATION }} and push ${{ matrix.docker.name }} Docker image
uses: docker/build-push-action@v6
with:
platforms: |-
linux/amd64
Expand Down
107 changes: 62 additions & 45 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,25 +35,31 @@ jobs:
AC_USERNAME: ${{ secrets.AC_USERNAME }}
AC_PASSWORD: ${{ secrets.AC_PASSWORD }}
AC_PROVIDER: ${{ secrets.AC_PROVIDER }}
SLIPPERS: ${{ secrets.SLIPPERS }}
id: release
run: |
brew install Bearer/tap/gon
[ -z SLIPPERS ] || eval "${SLIPPERS}"
gzip -9 pkg/bindata/files/{css,js}/*
gzip -9r pkg/bindata/templates/*
make signdmg
- name: upload artifacts
- name: Upload DMG Artifact
uses: actions/upload-artifact@v4
with:
name: dmg-release
path: release

release-test:
release:
# description: "Builds all the Notifiarr client binaries and packages for a release."
if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/unstable' || github.ref == 'refs/heads/main'
outputs:
version: ${{ steps.release.outputs.version }}
version: ${{ steps.vars.outputs.version }}
revision: ${{ steps.vars.outputs.revision }}
name: Make Release Assets
runs-on: ubuntu-latest
env:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
SLIPPERS: ${{ secrets.SLIPPERS }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -62,30 +68,48 @@ jobs:
- uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: make-release
- name: Get Version and Iteration
id: vars
run: |
source settings.sh
echo "Building v${VERSION}-${ITERATION}"
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "revision=${ITERATION}" >> $GITHUB_OUTPUT
- name: Make Release v${{steps.vars.outputs.version}}-${{steps.vars.outputs.revision}}
id: release
run: |
sudo apt install -y rpm fakeroot zip debsigs gnupg jq
sudo apt install -y rpm fakeroot zip debsigs gnupg jq libarchive-tools
sudo gem install --no-document fpm
echo "${GPG_SIGNING_KEY}" | gpg --import -
[ -z SLIPPERS ] || eval "${SLIPPERS}"
gzip -9 pkg/bindata/files/{css,js}/*
gzip -9r pkg/bindata/templates/*
make release
source settings.sh ; echo "version=${VERSION}-${ITERATION}" >> $GITHUB_OUTPUT
- name: upload artifacts
- name: Upload Release Artifacts v${{steps.vars.outputs.version}}-${{steps.vars.outputs.revision}}
uses: actions/upload-artifact@v4
with:
name: release
path: release

print-built-version:
needs:
- release
name: Built v${{needs.release.outputs.version}}-${{needs.release.outputs.revision}}
runs-on: ubuntu-latest
steps:
- name: Built v${{needs.release.outputs.version}}-${{needs.release.outputs.revision}}
run: echo Built v${{needs.release.outputs.version}}-${{needs.release.outputs.revision}}

deploy-unstable-unstable:
# description: "Uploads pre-built binaries to unstable.golift.io."
if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/unstable'
strategy:
matrix:
files: [release, dmg-release]
needs:
- release-test
- release
- macapp-test
name: Deploy Unstable.app
name: GoLift Unstable Deploy
runs-on: ubuntu-latest
steps:
- name: "Download files: ${{ matrix.files }}"
Expand All @@ -94,19 +118,20 @@ jobs:
name: ${{ matrix.files }}
- name: Upload files to unstable.golift.io
run: >-
for file in *.{zip,dmg,gz}; do
for file in *.{zip,dmg,gz,zst}; do
[ -f "$file" ] || continue;
echo "Uploading: ${file}";
curl -sSH "X-API-KEY: ${{ secrets.UNSTABLE_UPLOAD_KEY }}" "https://unstable.golift.io/upload.php?folder=notifiarr" -F "file=@${file}";
versionfile="${{needs.release-test.outputs.version}};filename=${file}.txt;type=text/plain";
curl -sSH "X-API-KEY: ${{ secrets.UNSTABLE_UPLOAD_KEY }}" "https://unstable.golift.io/upload.php?folder=notifiarr" -F "file=${versionfile}";
echo '{"version":"${{needs.release.outputs.version}}","revision":${{needs.release.outputs.revision}},"size":'$(stat --printf="%s" ${file})'}' >> ${file}.txt
curl -sSH "X-API-KEY: ${{ secrets.UNSTABLE_UPLOAD_KEY }}" "https://unstable.golift.io/upload.php?folder=notifiarr" -F "file=@${file}.txt";
done
deploy-unstable-packagecloud:
# description: "Uploads pre-built RPM and DEB packages to packagecloud.io/golift"
if: github.ref == 'refs/heads/unstable'
needs: release-test
name: Deploy Unstable PackageCloud
needs:
- release
name: PackageCloud Unstable Deploy
runs-on: ubuntu-latest
steps:
- name: Download release files
Expand All @@ -124,8 +149,9 @@ jobs:
deploy-packagecloud:
# description: "Uploads pre-built RPM and DEB packages to packagecloud.io/golift"
if: startsWith(github.ref, 'refs/tags/v')
needs: release-test
name: Deploy Release PackageCloud
needs:
- release
name: PackageCloud Release Deploy
runs-on: ubuntu-latest
steps:
- name: Download release files
Expand All @@ -140,12 +166,14 @@ jobs:
rpmdists: el/6
debdists: ubuntu/focal

deploy-github-release:
deploy-github:
# description: uploads all the built release assets to the GitHub Release.
if: startsWith(github.ref, 'refs/tags/v')
permissions:
contents: write
needs: [release-test, macapp-test]
needs:
- release
- macapp-test
strategy:
matrix:
files: [release, dmg-release]
Expand All @@ -167,31 +195,20 @@ jobs:
*.dmg
*.gz
*.txt
*.zst
archlinux-aur:
# description: creates and uploads and aur file to the golift/aur repo for arch linux.
needs: deploy-github-release
name: Deploy ArchLinux AUR
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Deploy Aurch AUR
run: bash init/archlinux/aur-deploy.sh
env:
DEPLOY_KEY: ${{ secrets.AUR_DEPLOY_KEY }}

homebrew-formula:
# description: creates and uploads a homebrew formula file to the golift/homebrew-mugs repo.
needs: deploy-github-release
name: Deploy Homebrew Formula
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Deploy Homebrew Formula
run: bash init/homebrew/formula-deploy.sh
env:
DEPLOY_KEY: ${{ secrets.HOMEBREW_DEPLOY_KEY }}
# archlinux-aur:
# # description: creates and uploads a PKGBUILD file to the golift/aur repo for arch linux.
# needs:
# - release
# - deploy-github
# name: Deploy ArchLinux AUR
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# with:
# fetch-depth: '0'
# - name: Deploy Aurch AUR
# run: bash init/archlinux/aur-deploy.sh
# env:
# DEPLOY_KEY: ${{ secrets.AUR_DEPLOY_KEY }}
49 changes: 13 additions & 36 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,19 @@
issues:
exclude-rules:
# Exclude funlen for testing files.
- linters:
- nonamedreturns
- wsl
- cyclop
- nolintlint
path: 'cmd/'
max-issues-per-linter: 0
max-same-issues: 0
linters:
enable-all: true
disable:
# deprecated
- maligned
- scopelint
- interfacer
- golint
- exhaustivestruct
- nosnakecase
- structcheck
- deadcode
- varcheck
- ifshort
# unused
- exhaustruct
- exhaustive
- dupl
- nlreturn
- nonamedreturns
- varnamelen
- godot
- perfsprint
# unneeded (broken because of generics)
- rowserrcheck
- wastedassign
- sqlclosecheck
#- revive # TODO: fix this one.
- musttag # broken in 1.52.
- depguard
- tagalign
- gomnd
- execinquery
# unused
- exhaustruct # This will never work in this app.
- dupl # Maybe one day we can reduce the duplicate code with generics.
- nlreturn # Not needed because wsl is good enough; better actually.
- godot # Does not work with annotations.
- depguard # Not even sure why this is useful. We have too many deps to care.
run:
timeout: 5m
timeout: 5m
output:
sort-results: true
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020-2023 Go Lift - Building Strong Go Tools
Copyright (c) 2020-2024 Go Lift - Building Strong Go Tools

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading

0 comments on commit 8e44546

Please sign in to comment.