fix(ci): Added semrelease and Woodpecker config 🔧

This commit is contained in:
2024-04-02 14:00:21 +13:00
parent 0b309228d3
commit 77fb819342
2 changed files with 115 additions and 12 deletions

View File

@@ -1,14 +1,17 @@
release: "github" release: "gitea"
github: github:
repo: "go-semantic-release" repo: "go-semantic-release"
user: "nightapes" user: "cybercinch"
url: "https://hub.cybercinch.nz"
commitFormat: angular commitFormat: angular
branch: branch:
master: release master: release
beta: beta develop: beta
assets: assets:
- name: ./build/go-semantic-release.linux_x86_64 - name: ./build/go-semantic-release.linux_x86_64
compress: true compress: true
- name: ./build/go-semantic-release.linux_arm64
compress: true
- name: ./build/go-semantic-release.windows_i386.exe - name: ./build/go-semantic-release.windows_i386.exe
compress: true compress: true
- name: ./build/go-semantic-release.windows_x86_64.exe - name: ./build/go-semantic-release.windows_x86_64.exe
@@ -18,15 +21,9 @@ assets:
changelog: changelog:
docker: docker:
latest: true latest: true
repository: "nightapes/go-semantic-release" repository: "cybercinch/go-semantic-release"
showAuthors: true showAuthors: true
hooks: hooks:
preRelease: preRelease: []
- docker build -t nightapes/go-semantic-release:latest . postRelease: []
- docker tag nightapes/go-semantic-release:latest docker.pkg.github.com/nightapes/go-semantic-release/go-semantic-release:$RELEASE_VERSION
- docker tag nightapes/go-semantic-release:latest nightapes/go-semantic-release:$RELEASE_VERSION
postRelease:
- docker push nightapes/go-semantic-release:latest
- docker push nightapes/go-semantic-release:$RELEASE_VERSION
- docker push docker.pkg.github.com/nightapes/go-semantic-release/go-semantic-release:$RELEASE_VERSION

106
.woodpecker.yml Normal file
View File

@@ -0,0 +1,106 @@
variables:
- &platforms 'linux/arm/v7,linux/arm64/v8,linux/amd64'
- &docker_creds
username:
from_secret: hub_username_cybercinch
password:
from_secret: docker_password_cybercinch
- &pypi_creds
username:
from_secret: hub_username_cybercinch
password:
from_secret: docker_password_cybercinch
steps:
build-release:
image: docker.io/cybercinch/go-semrelease:golang1.20
pull: true
commands:
- >
GOOS=linux
GOARCH=amd64
CGO_ENABLED=0
go build -o build/go-semantic-release.linux_x86_64 -ldflags "-w -s --X main.version=`go-semantic-release next`"
./cmd/go-semantic-release/
- >
GOOS=linux
GOARCH=arm64
CGO_ENABLED=0
go build -o build/go-semantic-release.linux_arm64 -ldflags "-w -s --X main.version=`go-semantic-release next`"
./cmd/go-semantic-release/
- >
GOOS=windows
GOARCH=386
CGO_ENABLED=0
go build -o build/go-semantic-release.windows_i386.exe -ldflags "-w -s -X main.version=`go-semantic-release next`"
./cmd/go-semantic-release/
- >
GOOS=windows
GOARCH=amd64
CGO_ENABLED=0
go build -o build/go-semantic-release.windows_x86_64.exe -ldflags "-w -s -X main.version=`go-semantic-release next`"
./cmd/go-semantic-release/
- >
GOOS=darwin
GOARCH=amd64
CGO_ENABLED=0
go build -o build/go-semantic-release.darwin_x86_64 -ldflags "-w -s -X main.version=`go-semantic-release next`"
./cmd/go-semantic-release/
- go-semantic-release release # Actually make the release on Gitea. Uploading assets
environment:
GITEA_TOKEN:
from_secret: gitea_token
when:
branch: ${CI_REPO_DEFAULT_BRANCH}
event:
- push
- manual
publish-docker-tagged:
image: docker.io/cybercinch/woodpecker-plugin-depot
pull: true
settings:
<<: *docker_creds
token:
from_secret: depot_token
repohost: hub.cybercinch.nz
repo: cybercinch/${CI_REPO_NAME}
project:
from_secret: depot_project
dockerfile: Dockerfile
push: true
platforms: *platforms
tags: ["latest", "$CI_COMMIT_TAG"]
when:
branch: ${CI_REPO_DEFAULT_BRANCH}
event:
- tag
update-swarm-service-portainer:
image: docker.io/plugins/webhook
settings:
urls:
from_secret: deploy_url
method: POST
when:
branch: ${CI_REPO_DEFAULT_BRANCH}
publish-docker-develop:
image: docker.io/cybercinch/woodpecker-plugin-depot
pull: true
settings:
<<: *docker_creds
token:
from_secret: depot_token
repohost: hub.cybercinch.nz
repo: cybercinch/${CI_REPO_NAME}
project:
from_secret: depot_project
dockerfile: Dockerfile
push: true
platforms: *platforms
tags: ["develop"]
when:
branch: develop
event:
- push
- manual