feat: added new to get version supported #11
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Generate a new version | |
on: | |
push: | |
paths: | |
- 'addons/admob/plugin.cfg' | |
jobs: | |
generate-version: | |
name: Send version | |
runs-on: "ubuntu-latest" | |
steps: | |
- uses: actions/[email protected] | |
- name: Verify if has the correct version in order to publish | |
run: | | |
VERSION=$(grep version addons/admob/plugin.cfg | cut -d'=' -f2 | sed 's/"//g') | |
if [[ "$VERSION" != godot[0-9]*-v[0-9].[0-9].[0-9] ]]; then | |
echo "The version is not in the correct format: godotX-vX.X.X" >&2 | |
exit 1 | |
fi | |
echo "PLUGIN_VERSION=$VERSION" >> $GITHUB_ENV | |
- name: Set LAST_COMMIT_HASH variable | |
run: | | |
echo "LAST_COMMIT_HASH=$(git log -1 --pretty=format:%H)" >> $GITHUB_ENV | |
- name: Create Release | |
uses: ncipollo/[email protected] | |
with: | |
generateReleaseNotes: true | |
commit: ${{env.LAST_COMMIT_HASH}} | |
tag: ${{env.PLUGIN_VERSION}} | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.8' | |
- name: Install requests | |
run: pip install requests | |
- name: Upload new version to Godot Asset Library | |
env: | |
USERNAME: ${{ secrets.ASSET_LIBRARY_USERNAME }} | |
PASSWORD: ${{ secrets.ASSET_LIBRARY_PASSWORD }} | |
VERSION: ${{env.PLUGIN_VERSION}} | |
COMMIT_HASH: ${{env.LAST_COMMIT_HASH}} | |
run: | | |
python3 static/workflow_files/push.py |