diff --git a/.drone.star b/.drone.star index 3ef94df070..812ce5878e 100644 --- a/.drone.star +++ b/.drone.star @@ -71,51 +71,12 @@ def main(ctx): # implemented for: ocisIntegrationTests and s3ngIntegrationTests return [ checkStarlark(), - release(), litmusOcisOldWebdav(), litmusOcisNewWebdav(), litmusOcisSpacesDav(), virtualViews(), ] + ocisIntegrationTests(6) + s3ngIntegrationTests(12) -def release(): - return { - "kind": "pipeline", - "type": "docker", - "name": "release", - "platform": { - "os": "linux", - "arch": "amd64", - }, - "trigger": { - "event": { - "include": [ - "tag", - ], - }, - }, - "steps": [ - { - "name": "create-dist", - "image": "registry.cern.ch/docker.io/library/golang:1.19", - "commands": [ - "go run tools/create-artifacts/main.go -version ${DRONE_TAG} -commit ${DRONE_COMMIT} -goversion `go version | awk '{print $$3}'`", - ], - }, - { - "name": "publish", - "image": "registry.cern.ch/docker.io/plugins/github-release", - "settings": { - "api_key": { - "from_secret": "github_token", - }, - "files": "dist/*", - "note": "changelog/NOTE.md", - }, - }, - ], - } - def virtualViews(): return { "kind": "pipeline", diff --git a/.github/workflows/check-changelog.yml b/.github/workflows/changelog.yml similarity index 100% rename from .github/workflows/check-changelog.yml rename to .github/workflows/changelog.yml diff --git a/.github/workflows/build-docker.yml b/.github/workflows/docker.yml similarity index 100% rename from .github/workflows/build-docker.yml rename to .github/workflows/docker.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000..707c928b9f --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,24 @@ +name: Release +on: + push: + tags: + - "*" + +jobs: + release: + runs-on: self-hosted + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Go environment + uses: actions/setup-go@v3.3.0 + with: + go-version-file: go.mod + - name: Make distribution + run: make dist VERSION=${{ github.ref_name }} GIT_COMMIT=${{ github.sha }} GO_VERSION=$(go version | awk '{print $3}') + - name: Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: "dist/*" + body_path: "changelog/NOTE.md" diff --git a/Makefile b/Makefile index 9cdde771e9..b2fd68bc1e 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ SHELL := /bin/bash BUILD_DATE=`date +%FT%T%z` -GIT_COMMIT=`git rev-parse --short HEAD` +GIT_COMMIT ?= `git rev-parse --short HEAD` GIT_BRANCH=`git rev-parse --symbolic-full-name --abbrev-ref HEAD` GIT_DIRTY=`git diff-index --quiet HEAD -- || echo "dirty-"` -VERSION=`git describe --always` -GO_VERSION=`go version | awk '{print $$3}'` +VERSION ?= `git describe --always` +GO_VERSION ?= `go version | awk '{print $$3}'` MINIMUM_GO_VERSION=1.16.2 BUILD_FLAGS="-X main.gitCommit=${GIT_COMMIT} -X main.version=${VERSION} -X main.goVersion=${GO_VERSION} -X main.buildDate=${BUILD_DATE}" CI_BUILD_FLAGS="-w -extldflags "-static" -X main.gitCommit=${GIT_COMMIT} -X main.version=${VERSION} -X main.goVersion=${GO_VERSION} -X main.buildDate=${BUILD_DATE}" @@ -159,7 +159,7 @@ clean: toolchain-clean all: build test lint gen-doc # create local build versions -dist: all +dist: gen-doc go run tools/create-artifacts/main.go -version ${VERSION} -commit ${GIT_COMMIT} -goversion ${GO_VERSION} BEHAT_BIN=vendor-bin/behat/vendor/bin/behat