Skip to content

Commit 9bdbbdb

Browse files
authored
chore(workflow): migrate release tagging from travis to github actions (#12)
* add downstream tagging via Github Release management action. * remove travis * use env.RELASE_TAG instead of ${RELEASE_TAG} * update token name to GR_TOKEN * update alpine images to 3.12.6 Signed-off-by: Akhil Mohan <[email protected]>
1 parent 0783d48 commit 9bdbbdb

File tree

5 files changed

+32
-213
lines changed

5 files changed

+32
-213
lines changed

.github/workflows/release.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ jobs:
9494
DBUILD_DATE=${{ steps.date.outputs.DATE }}
9595
DBUILD_REPO_URL=https://github.com/openebs/linux-utils
9696
DBUILD_SITE_URL=https://openebs.io
97-
RELEASE_TAG=${RELEASE_TAG}
97+
RELEASE_TAG=${{ env.RELEASE_TAG }}
9898
9999
trivy:
100100
runs-on: ubuntu-latest
@@ -116,3 +116,22 @@ jobs:
116116
exit-code: '1'
117117
ignore-unfixed: true
118118
severity: 'CRITICAL,HIGH'
119+
120+
downstream-tagging:
121+
runs-on: ubuntu-latest
122+
# since trivy already depends on linux-utils, its not included here
123+
needs: ['trivy']
124+
steps:
125+
- name: Downstream tagging
126+
uses: akhilerm@[email protected]
127+
with:
128+
tag-name: ${{ github.ref }}
129+
body: 'Release created from linux-utils'
130+
repo: |
131+
jiva
132+
cstor
133+
libcstor
134+
dynamic-localpv-provisioner
135+
m-exporter
136+
# GR_TOKEN secret is the access token to perform github releases
137+
github-token: ${{ secrets.GR_TOKEN }}

.travis.yml

Lines changed: 0 additions & 74 deletions
This file was deleted.

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM alpine:3.12.4
1+
FROM alpine:3.12.6
22
RUN apk add --no-cache util-linux
33

44
ARG DBUILD_DATE

buildscripts/git-release

Lines changed: 0 additions & 126 deletions
This file was deleted.

buildscripts/push

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ BUILD_ID=$(git describe --tags --always)
5959

6060
# Determine the current branch
6161
CURRENT_BRANCH=""
62-
if [ -z ${TRAVIS_BRANCH} ];
62+
if [ -z ${BRANCH} ];
6363
then
6464
CURRENT_BRANCH=$(git branch | grep \* | cut -d ' ' -f2)
6565
else
66-
CURRENT_BRANCH=${TRAVIS_BRANCH}
66+
CURRENT_BRANCH=${BRANCH}
6767
fi
6868

6969
#Depending on the branch where builds are generated,
@@ -106,12 +106,12 @@ then
106106
# This unique/build image will be pushed to corresponding ci repo.
107107
TagAndPushImage "${DIMAGE}-ci" "${BUILD_TAG}"
108108

109-
if [ ! -z "${TRAVIS_TAG}" ] ;
109+
if [ ! -z "${RELEASE_TAG}" ] ;
110110
then
111111
# Push with different tags if tagged as a release
112-
# When github is tagged with a release, then Travis will
113-
# set the release tag in env TRAVIS_TAG
114-
TagAndPushImage "${DIMAGE}" "${TRAVIS_TAG}"
112+
# When github is tagged with a release, then github action will
113+
# set the release tag in env RELEASE_TAG
114+
TagAndPushImage "${DIMAGE}" "${RELEASE_TAG}"
115115
TagAndPushImage "${DIMAGE}" "latest"
116116
fi;
117117
else
@@ -126,13 +126,13 @@ then
126126
# Push CI tagged image - :ci or :branch-ci
127127
TagAndPushImage "quay.io/${DIMAGE}" "${CI_TAG}"
128128

129-
if [ ! -z "${TRAVIS_TAG}" ] ;
129+
if [ ! -z "${RELEASE_TAG}" ] ;
130130
then
131131
# Push with different tags if tagged as a release
132-
# When github is tagged with a release, then Travis will
133-
# set the release tag in env TRAVIS_TAG
134-
# Trim the `v` from the TRAVIS_TAG if it exists
135-
TagAndPushImage "quay.io/${DIMAGE}" "${TRAVIS_TAG}"
132+
# When github is tagged with a release, then github action will
133+
# set the release tag in env RELEASE_TAG
134+
# Trim the `v` from the RELEASE_TAG if it exists
135+
TagAndPushImage "quay.io/${DIMAGE}" "${RELEASE_TAG}"
136136
TagAndPushImage "quay.io/${DIMAGE}" "latest"
137137
fi;
138138
else

0 commit comments

Comments
 (0)