Merge pull request #54 from Azure/feature/github_actions

Add github actions workflow for release
This commit is contained in:
nidhi0622 2024-06-11 12:20:23 -05:00 коммит произвёл GitHub
Родитель 2a343bd1ad 23579fda76
Коммит e915393235
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 39 добавлений и 0 удалений

39
.github/workflows/release.yaml поставляемый Normal file
Просмотреть файл

@ -0,0 +1,39 @@
# Based on example from https://github.com/actions/upload-release-asset
# This is to maintain with Scalelib version
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- '3*' # Push events to matching v*, i.e. v1.0, v20.15.10
name: Upload Release Asset
jobs:
build:
name: Upload Release Asset
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build pkg
run:
sudo apt update || apt update;
sudo apt install -y dos2unix;
sudo apt-get install -y python3 python3-pip || apt-get install -y python3 python3-pip;
pip3 install virtualenv;
python3 -m virtualenv $GITHUB_WORKSPACE/.venv/;
source $GITHUB_WORKSPACE/.venv/bin/activate && python package.py;
- name: Get the version
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Create and Upload Release Asset
id: upload-release-asset
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.ACTION_PAT }}
with:
tag_name: ${{ steps.get_version.outputs.version }}
name: Release ${{ steps.get_version.outputs.version }}
draft: false
prerelease: true
files: dist/cyclecloud-symphony-pkg-${{ steps.get_version.outputs.version }}.zip