Skip to content

Commit

Permalink
Adds GitHub workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
YvesLepidus committed Jan 27, 2025
1 parent 35c4faf commit 2a195c8
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 2 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/generate-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
on:
push:
tags:
- 'v*'

name: Create release and tar.gz package for it

jobs:
create-release:
name: Create release and package
env:
PLUGIN_NAME: tabsForSubmissionStages
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: recursive
- name: Check version.xml
run: |
sudo apt install xmlstarlet
application=$(xmlstarlet sel -t -v 'version/application' version.xml)
if [ $application != $PLUGIN_NAME ]; then exit 1; fi
release=$(xmlstarlet sel -t -v 'version/release' version.xml)
tag=${{ github.ref }}
tag=${tag/refs\/tags\/v}
if [[ $release != $tag* ]]; then exit 1; fi
date_version=$(xmlstarlet sel -t -v 'version/date' version.xml)
current_date=$(date +'%Y-%m-%d')
if [ $date_version != $current_date ]; then exit 1; fi
shell: bash
- name: Create the tar.gz package
run: |
mkdir $PLUGIN_NAME
shopt -s extglob
cp -r !($PLUGIN_NAME|.git*|.|..|tests|cypress) $PLUGIN_NAME
tar -zcvf $PLUGIN_NAME.tar.gz $PLUGIN_NAME
shell: bash
- name: Create the release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Upload the package as release asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ env.PLUGIN_NAME }}.tar.gz
asset_name: ${{ env.PLUGIN_NAME }}.tar.gz
asset_content_type: application/x-compressed-tar
4 changes: 2 additions & 2 deletions version.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
<version>
<application>tabsForSubmissionStages</application>
<type>plugins.generic</type>
<release>0.0.0.4</release>
<date>2025-01-23</date>
<release>0.0.0.5</release>
<date>2025-01-27</date>
</version>

0 comments on commit 2a195c8

Please sign in to comment.