Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[d8-trdl] Add trdl files release deploy #65

Closed
wants to merge 21 commits into from
27 changes: 27 additions & 0 deletions .github/workflows/release_trdl-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: trdl-release
on:
create:
tags:
- v*
pull_request:
branches:
- "main"

jobs:
release:
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
name: Perform deckhouse-cli release using trdl server
# runs-on: [self-hosted, regular]
# container:
# image: ubuntu:22.04
runs-on: ubuntu-latest
steps:
- name: Release
uses: werf/trdl-vault-actions/release@main
with:
vault-addr: ${{ secrets.TRDL_VAULT_ADDR }}
project-name: deckhouse-cli
git-tag: ${{ github.event.ref }}
vault-auth-method: approle
vault-role-id: ${{ secrets.TRDL_VAULT_ROLE_ID }}
vault-secret-id: ${{ secrets.TRDL_VAULT_SECRET_ID }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ bin/
d8
dist/
build/
release-build/
14 changes: 13 additions & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,18 @@ vars:
goReleaseLDFlags: "-s -w -X 'github.com/deckhouse/deckhouse-cli/cmd.Version={{ .version }}' -X github.com/werf/werf/pkg/werf.Version={{ .version }} {{ .kubectlLDFlags }}"

tasks:
sign:
desc: 'Sign last version tag + origin/main and push signatures. Important vars: "refs".'
cmds:
- git fetch --tags -f
- git signatures pull {{.CLI_ARGS}}
- |
for ref in {{.refs | default "$(git tag --sort=v:refname | tail -n1) origin/main origin/trdl"}}; do
echo Signing $ref...
git signatures add {{.CLI_ARGS}} $ref
git signatures show {{.CLI_ARGS}} $ref
done
- git signatures push {{.CLI_ARGS}}
_build:cgo:dev:
internal: true
cmds:
Expand Down Expand Up @@ -247,4 +259,4 @@ tasks:
clean:
desc: Clean all binaries
cmds:
- rm -rf ./build ./dist ./d8
- rm -rf ./build ./dist ./d8
11 changes: 11 additions & 0 deletions scripts/ci/release-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh -e

VERSION=$1
if [ -z "$VERSION" ] ; then
echo "Required version argument!" 1>&2
echo 1>&2
echo "Usage: $0 VERSION" 1>&2
exit 1
fi

#task build-and-package
3 changes: 3 additions & 0 deletions trdl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
docker_image: golang:1.23-alpine@sha256:c694a4d291a13a9f9d94933395673494fc2cc9d4777b85df3a7e70b3492d3574
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's use registry.deckhouse.io/base_images/golang:1.23.1-bullseye@sha256:a24507d1a36fce86431198a979435dadb187e8d0ce0b5c181f46d6788d84a40f here

commands:
- ./scripts/ci/release-build.sh {{ .Tag }} && cp -a release-build/{{ .Tag }}/* /result