Skip to content

Commit 5c23a3e

Browse files
committed
add release job
1 parent ef8ad5a commit 5c23a3e

File tree

2 files changed

+57
-1
lines changed

2 files changed

+57
-1
lines changed

.github/workflows/release.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Release
2+
3+
on:
4+
- push
5+
- pull_request
6+
7+
env:
8+
MYSQL_ROOT_PASSWORD: root
9+
10+
jobs:
11+
release:
12+
runs-on: ubuntu-latest
13+
timeout-minutes: 30
14+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
19+
- name: Set version number
20+
id: version
21+
run: |
22+
RELEASE_VERSION="${GITHUB_REF##*/}";
23+
RELEASE_FILE="ushahidi-platform-release-${RELEASE_VERSION}.tar.gz"
24+
echo "RELEASE_VERSION=${RELEASE_VERSION}" >> $GITHUB_OUTPUT
25+
echo "RELEASE_FILE=${RELEASE_FILE}" >> $GITHUB_OUTPUT
26+
27+
- name: Build image
28+
uses: docker/build-push-action@v3
29+
with:
30+
context: .
31+
push: false
32+
load: true
33+
tags: local/platform-release:latest
34+
build-args: |
35+
GIT_COMMIT_ID=${{ github.sha }}
36+
GIT_BUILD_REF=${{ github.head_ref }}
37+
38+
- name: Prepare folder
39+
run:
40+
mkdir -p tmp/out
41+
42+
- name: Create release file
43+
uses: addnab/docker-run-action@v3
44+
with:
45+
image: local/platform-release:latest
46+
run: /bin/bash /entrypoint.CES.sh build
47+
options: |
48+
-e RELEASE_VERSION=${{ steps.version.outputs.RELEASE_VERSION }}
49+
-v ${{ github.workspace }}/tmp/out:/vols/out
50+
51+
- name: Upload tarball
52+
uses: softprops/action-gh-release@v1
53+
with:
54+
draft: true
55+
files: |
56+
tmp/out/${{ steps.version.outputs.RELEASE_FILE }}

build_env.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
client_version=v2024.03.0
22
api_version=v2024.03.0
3-
release_version=${CI_BRANCH:-v6.0.0}
3+
release_version=${RELEASE_VERSION:-v6.0.0}
44

55
client_url=
66
api_url=

0 commit comments

Comments
 (0)