Skip to content

Commit

Permalink
add release job
Browse files Browse the repository at this point in the history
  • Loading branch information
tuxpiper committed Jan 21, 2024
1 parent ef8ad5a commit 5c23a3e
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 1 deletion.
56 changes: 56 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Release

on:
- push
- pull_request

env:
MYSQL_ROOT_PASSWORD: root

jobs:
release:
runs-on: ubuntu-latest
timeout-minutes: 30
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')

steps:
- uses: actions/checkout@v3

- name: Set version number
id: version
run: |
RELEASE_VERSION="${GITHUB_REF##*/}";
RELEASE_FILE="ushahidi-platform-release-${RELEASE_VERSION}.tar.gz"
echo "RELEASE_VERSION=${RELEASE_VERSION}" >> $GITHUB_OUTPUT
echo "RELEASE_FILE=${RELEASE_FILE}" >> $GITHUB_OUTPUT
- name: Build image
uses: docker/build-push-action@v3
with:
context: .
push: false
load: true
tags: local/platform-release:latest
build-args: |
GIT_COMMIT_ID=${{ github.sha }}
GIT_BUILD_REF=${{ github.head_ref }}
- name: Prepare folder
run:
mkdir -p tmp/out

- name: Create release file
uses: addnab/docker-run-action@v3
with:
image: local/platform-release:latest
run: /bin/bash /entrypoint.CES.sh build
options: |
-e RELEASE_VERSION=${{ steps.version.outputs.RELEASE_VERSION }}
-v ${{ github.workspace }}/tmp/out:/vols/out
- name: Upload tarball
uses: softprops/action-gh-release@v1
with:
draft: true
files: |
tmp/out/${{ steps.version.outputs.RELEASE_FILE }}
2 changes: 1 addition & 1 deletion build_env.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
client_version=v2024.03.0
api_version=v2024.03.0
release_version=${CI_BRANCH:-v6.0.0}
release_version=${RELEASE_VERSION:-v6.0.0}

client_url=
api_url=
Expand Down

0 comments on commit 5c23a3e

Please sign in to comment.