Update version and add a publish workflow

This commit is contained in:
Prathamesh Musale 2025-12-03 21:24:45 +05:30
parent 003a6d8d52
commit c6be5c3b58
4 changed files with 56 additions and 7 deletions

49
.github/workflows/publish.yml vendored Normal file
View File

@ -0,0 +1,49 @@
name: Release
on:
release:
types: [created]
env:
TERM: dumb
jobs:
build-and-release:
name: Build and Upload Release Assets
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version: ^1.21
id: go
- name: Check out code
uses: actions/checkout@v4
- name: Build Linux AMD64 binary
run: make cross
- name: Check binary permissions
run: |
cd bin
ls -la kompose-linux-amd64
- name: Get the version
id: vars
run: |
echo ::set-output name=tag::$(echo ${GITHUB_REF#refs/tags/})
- name: Upload binary to release assets
uses: https://gitea.com/cerc-io/action-gh-release@gitea-v2
with:
files: ./bin/kompose-linux-amd64
token: ${{ secrets.CICD_PUBLISH_TOKEN }}
- name: Publish binary as generic package
run: |
curl --user "${{ github.repository_owner }}:${{ secrets.CICD_PUBLISH_TOKEN }}" \
--upload-file ./bin/kompose-linux-amd64 \
"https://git.vdb.to/api/packages/${{ github.repository_owner }}/generic/kompose/${{ steps.vars.outputs.tag }}/kompose-linux-amd64"

View File

@ -49,11 +49,11 @@ install:
.PHONY: cross
cross:
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 GO111MODULE=on go build ${BUILD_FLAGS} -installsuffix cgo -o "bin/kompose-linux-amd64" main.go
GOOS=linux GOARCH=arm CGO_ENABLED=0 GO111MODULE=on go build ${BUILD_FLAGS} -installsuffix cgo -o "bin/kompose-linux-arm" main.go
GOOS=linux GOARCH=arm64 CGO_ENABLED=0 GO111MODULE=on go build ${BUILD_FLAGS} -installsuffix cgo -o "bin/kompose-linux-arm64" main.go
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 GO111MODULE=on go build ${BUILD_FLAGS} -installsuffix cgo -o "bin/kompose-windows-amd64.exe" main.go
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 GO111MODULE=on go build ${BUILD_FLAGS} -installsuffix cgo -o "bin/kompose-darwin-amd64" main.go
GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 GO111MODULE=on go build ${BUILD_FLAGS} -installsuffix cgo -o "bin/kompose-darwin-arm64" main.go
# GOOS=linux GOARCH=arm CGO_ENABLED=0 GO111MODULE=on go build ${BUILD_FLAGS} -installsuffix cgo -o "bin/kompose-linux-arm" main.go
# GOOS=linux GOARCH=arm64 CGO_ENABLED=0 GO111MODULE=on go build ${BUILD_FLAGS} -installsuffix cgo -o "bin/kompose-linux-arm64" main.go
# GOOS=windows GOARCH=amd64 CGO_ENABLED=0 GO111MODULE=on go build ${BUILD_FLAGS} -installsuffix cgo -o "bin/kompose-windows-amd64.exe" main.go
# GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 GO111MODULE=on go build ${BUILD_FLAGS} -installsuffix cgo -o "bin/kompose-darwin-amd64" main.go
# GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 GO111MODULE=on go build ${BUILD_FLAGS} -installsuffix cgo -o "bin/kompose-darwin-arm64" main.go
.PHONY: clean
clean:

View File

@ -1 +1 @@
1.37.0
1.37.0-zenith-0.0.1

View File

@ -2,7 +2,7 @@ package version
var (
// VERSION is version number that will be displayed when running ./kompose version
VERSION = "1.37.0"
VERSION = "1.37.0-zenith-0.0.1"
// GITCOMMIT is hash of the commit that will be displayed when running ./kompose version
// this will be overwritten when running build like this: go build -ldflags="-X github.com/kubernetes/kompose/pkg/version.GITCOMMIT=$(GITCOMMIT)"
// HEAD is default indicating that this was not set during build