Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added CI workflow #22

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: CI

on:
push:
branches:
- main

jobs:
Release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
steps:

- name: Checkout code
uses: actions/checkout@v4

- name: Get version
id: get_version
run: |
RELEASE_VERSION=$(awk -F'__version__ =' '{print $2}' src/helpers/__version__.py| tr -d "[] '\"")
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
echo "release_version=$RELEASE_VERSION" >> $GITHUB_OUTPUT
echo "Name ${{ github.ref_name }}. Version $RELEASE_VERSION"

- name: Downloads artifacts
run: |
curl "https://public-open-source-syndicate-artifacts.s3.amazonaws.com/ecc/${{ github.ref_name }}/rule-engine-ami-artifacts.linux-arm64.zip -o rule-engine-ami-artifacts.linux-arm64.zip"

- name: Create tag
uses: actions/github-script@v7
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/${{ steps.get_version.outputs.release_version }}',
sha: context.sha
})

- name: Create release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.get_version.outputs.release_version }}
name: ${{ steps.get_version.outputs.release_version }}
body: "Release ${{ steps.get_version.outputs.release_version }}"
prerelease: false
draft: false
make_latest: true
files: rule-engine-ami-artifacts.linux-arm64.zip