Skip to content

Commit

Permalink
add wechat push & change github action & fix test & fix goreleaser.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
bigmangos committed Nov 12, 2023
1 parent 14a468d commit f4a56a0
Show file tree
Hide file tree
Showing 11 changed files with 366 additions and 152 deletions.
48 changes: 24 additions & 24 deletions .github/workflows/release-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,27 +31,27 @@ jobs:
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
publish:
needs:
- build
- test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Publish to Docker Hub
uses: jerray/publish-docker-action@87d84711629b0dc9f6bb127b568413cc92a2088e #master@2022-10-14
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
file: dockerfiles/Dockerfile.self-contained
repository: containrrr/watchtower
tags: latest-dev
- name: Publish to GHCR
uses: jerray/publish-docker-action@87d84711629b0dc9f6bb127b568413cc92a2088e #master@2022-10-14
with:
username: ${{ secrets.BOT_USERNAME }}
password: ${{ secrets.BOT_GHCR_PAT }}
file: dockerfiles/Dockerfile.self-contained
registry: ghcr.io
repository: containrrr/watchtower
tags: latest-dev
# publish:
# needs:
# - build
# - test
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Publish to Docker Hub
# uses: jerray/publish-docker-action@87d84711629b0dc9f6bb127b568413cc92a2088e #master@2022-10-14
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_PASSWORD }}
# file: dockerfiles/Dockerfile.self-contained
# repository: containrrr/watchtower
# tags: latest-dev
# - name: Publish to GHCR
# uses: jerray/publish-docker-action@87d84711629b0dc9f6bb127b568413cc92a2088e #master@2022-10-14
# with:
# username: ${{ secrets.BOT_USERNAME }}
# password: ${{ secrets.BOT_GHCR_PAT }}
# file: dockerfiles/Dockerfile.self-contained
# registry: ghcr.io
# repository: containrrr/watchtower
# tags: latest-dev
116 changes: 56 additions & 60 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ name: Release (Production)

on:
workflow_dispatch: {}
release:
types:
- created
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- '**/v[0-9]+.[0-9]+.[0-9]+'
Expand All @@ -22,9 +20,9 @@ jobs:
uses: actions/setup-go@v4
with:
go-version: 1.18.x
- uses: dominikh/staticcheck-action@ba605356b4b29a60e87ab9404b712f3461e566dc #v1.3.0
- uses: dominikh/[email protected]
with:
version: "2022.1.1"
version: "2022.1.3"
install-go: "false" # StaticCheck uses go v1.17 which does not support `any`

test:
Expand All @@ -35,8 +33,6 @@ jobs:
- 1.18.x
platform:
- ubuntu-latest
- macos-latest
- windows-latest
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout
Expand All @@ -59,7 +55,7 @@ jobs:
- lint
env:
CGO_ENABLED: 0
TAG: ${{ github.event.release.tag_name }}
TAG: ${{ github.ref }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -70,21 +66,21 @@ jobs:
with:
go-version: 1.18.x
- name: Login to Docker Hub
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc #v2
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GHCR
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc #v2
uses: docker/login-action@v2
with:
username: ${{ secrets.BOT_USERNAME }}
password: ${{ secrets.BOT_GHCR_PAT }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ghcr.io
- name: Build
uses: goreleaser/goreleaser-action@7ec5c2b0c6cdda6e8bbb49444bc797dd33d74dd8 #v3
uses: goreleaser/goreleaser-action@v4
with:
version: v0.155.0
args: --debug
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Enable experimental docker features
Expand All @@ -95,36 +91,36 @@ jobs:
run: |
export DH_TAG=$(git tag --points-at HEAD | sed 's/^v*//')
docker manifest create \
containrrr/watchtower:$DH_TAG \
containrrr/watchtower:amd64-$DH_TAG \
containrrr/watchtower:i386-$DH_TAG \
containrrr/watchtower:armhf-$DH_TAG \
containrrr/watchtower:arm64v8-$DH_TAG
bigmangos/watchtower:$DH_TAG \
bigmangos/watchtower:amd64-$DH_TAG \
bigmangos/watchtower:i386-$DH_TAG \
bigmangos/watchtower:armhf-$DH_TAG \
bigmangos/watchtower:arm64v8-$DH_TAG
docker manifest create \
ghcr.io/containrrr/watchtower:$DH_TAG \
ghcr.io/containrrr/watchtower:amd64-$DH_TAG \
ghcr.io/containrrr/watchtower:i386-$DH_TAG \
ghcr.io/containrrr/watchtower:armhf-$DH_TAG \
ghcr.io/containrrr/watchtower:arm64v8-$DH_TAG
ghcr.io/bigmangos/watchtower:$DH_TAG \
ghcr.io/bigmangos/watchtower:amd64-$DH_TAG \
ghcr.io/bigmangos/watchtower:i386-$DH_TAG \
ghcr.io/bigmangos/watchtower:armhf-$DH_TAG \
ghcr.io/bigmangos/watchtower:arm64v8-$DH_TAG
- name: Annotate manifest for version
run: |
for REPO in '' ghcr.io/ ; do
docker manifest annotate \
${REPO}containrrr/watchtower:$(echo $TAG | sed 's/^v*//') \
${REPO}containrrr/watchtower:i386-$(echo $TAG | sed 's/^v*//') \
${REPO}bigmangos/watchtower:$(echo $TAG | sed 's/refs\/tags\/v//') \
${REPO}bigmangos/watchtower:i386-$(echo $TAG | sed 's/refs\/tags\/v//') \
--os linux \
--arch 386
docker manifest annotate \
${REPO}containrrr/watchtower:$(echo $TAG | sed 's/^v*//') \
${REPO}containrrr/watchtower:armhf-$(echo $TAG | sed 's/^v*//') \
${REPO}bigmangos/watchtower:$(echo $TAG | sed 's/refs\/tags\/v//') \
${REPO}bigmangos/watchtower:armhf-$(echo $TAG | sed 's/refs\/tags\/v//') \
--os linux \
--arch arm
docker manifest annotate \
${REPO}containrrr/watchtower:$(echo $TAG | sed 's/^v*//') \
${REPO}containrrr/watchtower:arm64v8-$(echo $TAG | sed 's/^v*//') \
${REPO}bigmangos/watchtower:$(echo $TAG | sed 's/refs\/tags\/v//') \
${REPO}bigmangos/watchtower:arm64v8-$(echo $TAG | sed 's/refs\/tags\/v//') \
--os linux \
--arch arm64 \
--variant v8
Expand All @@ -133,36 +129,36 @@ jobs:
- name: Create manifest for latest
run: |
docker manifest create \
containrrr/watchtower:latest \
containrrr/watchtower:amd64-latest \
containrrr/watchtower:i386-latest \
containrrr/watchtower:armhf-latest \
containrrr/watchtower:arm64v8-latest
bigmangos/watchtower:latest \
bigmangos/watchtower:amd64-latest \
bigmangos/watchtower:i386-latest \
bigmangos/watchtower:armhf-latest \
bigmangos/watchtower:arm64v8-latest
docker manifest create \
ghcr.io/containrrr/watchtower:latest \
ghcr.io/containrrr/watchtower:amd64-latest \
ghcr.io/containrrr/watchtower:i386-latest \
ghcr.io/containrrr/watchtower:armhf-latest \
ghcr.io/containrrr/watchtower:arm64v8-latest
ghcr.io/bigmangos/watchtower:latest \
ghcr.io/bigmangos/watchtower:amd64-latest \
ghcr.io/bigmangos/watchtower:i386-latest \
ghcr.io/bigmangos/watchtower:armhf-latest \
ghcr.io/bigmangos/watchtower:arm64v8-latest
- name: Annotate manifest for latest
run: |
for REPO in '' ghcr.io/ ; do
docker manifest annotate \
${REPO}containrrr/watchtower:latest \
${REPO}containrrr/watchtower:i386-latest \
${REPO}bigmangos/watchtower:latest \
${REPO}bigmangos/watchtower:i386-latest \
--os linux \
--arch 386
docker manifest annotate \
${REPO}containrrr/watchtower:latest \
${REPO}containrrr/watchtower:armhf-latest \
${REPO}bigmangos/watchtower:latest \
${REPO}bigmangos/watchtower:armhf-latest \
--os linux \
--arch arm

docker manifest annotate \
${REPO}containrrr/watchtower:latest \
${REPO}containrrr/watchtower:arm64v8-latest \
${REPO}bigmangos/watchtower:latest \
${REPO}bigmangos/watchtower:arm64v8-latest \
--os linux \
--arch arm64 \
--variant v8
Expand All @@ -174,24 +170,24 @@ jobs:
DOCKER_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
run: |
docker login -u $DOCKER_USER -p $DOCKER_TOKEN && \
docker manifest push containrrr/watchtower:$(echo $TAG | sed 's/^v*//') && \
docker manifest push containrrr/watchtower:latest
docker manifest push bigmangos/watchtower:$(echo $TAG | sed 's/refs\/tags\/v//') && \
docker manifest push bigmangos/watchtower:latest
- name: Push manifests to GitHub Container Registry
env:
DOCKER_USER: ${{ secrets.BOT_USERNAME }}
DOCKER_TOKEN: ${{ secrets.BOT_GHCR_PAT }}
DOCKER_USER: ${{ github.actor }}
DOCKER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
docker login -u $DOCKER_USER -p $DOCKER_TOKEN ghcr.io && \
docker manifest push ghcr.io/containrrr/watchtower:$(echo $TAG | sed 's/^v*//') && \
docker manifest push ghcr.io/containrrr/watchtower:latest
docker manifest push ghcr.io/bigmangos/watchtower:$(echo $TAG | sed 's/refs\/tags\/v//') && \
docker manifest push ghcr.io/bigmangos/watchtower:latest
renew-docs:
name: Refresh pkg.go.dev
needs: build
runs-on: ubuntu-latest
steps:
- name: Pull new module version
uses: andrewslotin/go-proxy-pull-action@50fea06a976087614babb9508e5c528b464f4645 #master@2022-10-14
# renew-docs:
# name: Refresh pkg.go.dev
# needs: build
# runs-on: ubuntu-latest
# steps:
# - name: Pull new module version
# uses: andrewslotin/go-proxy-pull-action@50fea06a976087614babb9508e5c528b464f4645 #master@2022-10-14



Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ coverage.out
*.coverprofile

docs/assets/wasm_exec.js
docs/assets/*.wasm
docs/assets/*.wasm
wechat_test.go
1 change: 1 addition & 0 deletions docs/notifications.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ system, [logrus](http://github.com/sirupsen/logrus).
- `--notification-title-tag` (env. `WATCHTOWER_NOTIFICATION_TITLE_TAG`): Prefix to include in the title. Useful when running multiple watchtowers.
- `--notification-skip-title` (env. `WATCHTOWER_NOTIFICATION_SKIP_TITLE`): Do not pass the title param to notifications. This will not pass a dynamic title override to notification services. If no title is configured for the service, it will remove the title all together.
- `--notification-log-stdout` (env. `WATCHTOWER_NOTIFICATION_LOG_STDOUT`): Enable output from `logger://` shoutrrr service to stdout.
- `--notification-wechat-params` (env. `WATCHTOWER_NOTIFICATION_WECHAT_PARAMS`): The WeChat params to send notifications to.

## [shoutrrr](https://github.com/containrrr/shoutrrr) notifications

Expand Down
Loading

0 comments on commit f4a56a0

Please sign in to comment.