build: add publish release pipeline (#5)

Reviewed-on: https://git.vdx.hu/voidcontext/woodpecker-plugin-nix-attic/pulls/5
Co-authored-by: Gabor Pihaj <gabor.pihaj@gmail.com>
Co-committed-by: Gabor Pihaj <gabor.pihaj@gmail.com>
This commit is contained in:
Gabor Pihaj 2023-09-30 17:02:41 +00:00 committed by Gabor Pihaj
parent c8955246f1
commit fbe1ae9bc4
No known key found for this signature in database
GPG key ID: 7BCF5D144C6C06E3
3 changed files with 50 additions and 2 deletions

View file

@ -7,13 +7,15 @@ variables:
steps:
build:
when:
- event: [push pull_request]
image: git.vdx.hu/voidcontext/woodpecker-plugin-nix-attic
settings:
<<: *common_settings
# "persist" the generated image in the workspace
script: |
nix build .#woodpecker-plugin-nix-attic-latest
nix-env -iA nixpkgs.docker-client
# "persist" the generated image in the workspace
cp $(realpath result) docker-image-latest
docker load -i docker-image-latest
volumes:
@ -25,9 +27,9 @@ steps:
branch: main
settings:
<<: *common_settings
# "persist" the generated image in the workspace
script: |
nix-env -iA nixpkgs.docker-client
# re-load persisted image (just in case...)
docker load -i docker-image-latest
docker login -u vdx -p "$FORGEJO_REGISTRY_TOKEN" git.vdx.hu
docker push git.vdx.hu/voidcontext/woodpecker-plugin-nix-attic

26
.woodpecker/release.yaml Normal file
View file

@ -0,0 +1,26 @@
variables:
- common_settings: &common_settings
binary_cache: https://cache.nix.vdx.hu/private
binary_cache_public_key: private:b6wO7rXF+4WtPCocEKlbdU/bTqEdJAqRrzOu0O3cK68=
binary_cache_token:
from_secret: attic_token
steps:
release:
when:
- event: tag
image: git.vdx.hu/voidcontext/woodpecker-plugin-nix-attic
settings:
<<: *common_settings
# "persist" the generated image in the workspace
script: |
nix build .#woodpecker-plugin-nix-attic-release
nix-env -iA nixpkgs.docker-client
docker load -i result
docker login -u vdx -p "$FORGEJO_REGISTRY_TOKEN" git.vdx.hu
docker push git.vdx.hu/voidcontext/woodpecker-plugin-nix-attic:$CI_COMMIT_TAG
secrets:
- forgejo_registry_token
volumes:
- /var/run/docker.sock:/var/run/docker.sock

20
cog.toml Normal file
View file

@ -0,0 +1,20 @@
from_latest_tag = false
ignore_merge_commits = true
generate_mono_repository_global_tag = true
branch_whitelist = []
pre_bump_hooks = []
post_bump_hooks = []
pre_package_bump_hooks = []
post_package_bump_hooks = []
[git_hooks]
[commit_types]
[changelog]
path = "CHANGELOG.md"
authors = []
[bump_profiles]
[packages]