Skip to content

Commit

Permalink
Migrate the release job from Drone to GitHub Actions (#3521)
Browse files Browse the repository at this point in the history
  • Loading branch information
vascoguita authored Dec 5, 2022
1 parent 2e3ca5d commit 646e719
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 43 deletions.
39 changes: 0 additions & 39 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
File renamed without changes.
File renamed without changes.
24 changes: 24 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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"
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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}"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 646e719

Please sign in to comment.