feat(github-ci): release job

This commit is contained in:
maxime1907 2023-10-03 12:55:32 +02:00
parent cb68485dd1
commit e3397e3032

View File

@ -3,11 +3,17 @@ name: build
on:
push:
branches:
- main
- master
tags:
- '*'
paths-ignore:
- LICENSE
- README.md
pull_request:
branches:
- main
- master
paths-ignore:
- LICENSE
- README.md
@ -152,5 +158,36 @@ jobs:
- name: Uploading package
uses: actions/upload-artifact@v3
with:
name: cleaner-sm${{ matrix.sm_version }}-${{ matrix.os_short }}-${{ env.GITHUB_SHA_SHORT }}
name: ${{ github.event.repository.name }}-${{ matrix.sm_version }}-${{ matrix.os_short }}
path: src/build/package
release:
name: Release
if: startsWith(github.ref, 'refs/tags/')
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
- name: Package
run: |
version=`echo $GITHUB_REF | sed "s/refs\/tags\///"`
ls -Rall
for folder in ${{ github.event.repository.name }}*; do
if [ -d "$folder" ]; then
echo "Processing folder: $folder"
cd $folder
tar -czf ../$folder.tar.gz -T <(\ls -1)
cd ..
fi
done
- name: Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: '*.tar.gz'
tag: ${{ github.ref }}
file_glob: true