Skip to content

v0.34.1

v0.34.1 #27

Workflow file for this run

name: Update Version
on:
release:
types: [published]
workflow_dispatch:
inputs:
version:
description: 'Version to set (e.g., 1.0.0)'
required: true
default: '0.0.0'
jobs:
update-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Update js/versions.js
run: |
if [ "${{ github.event_name }}" = "release" ]; then
version=$(echo ${{ github.ref }} | sed 's/refs\/tags\///')
else
version=${{ github.event.inputs.version }}
fi
date=$(date +'%Y-%m-%d')
echo "Updating to version $version and date $date"
# Update version and releaseDate
sed -i 's/"version": ".*"/"version": "'"$version"'"/' js/versions.js
sed -i 's/"releaseDate": ".*"/"releaseDate": "'"$date"'"/' js/versions.js
# Add new changelog entry
sed -i '/"changelog": \[/a\ {\n "version": "'"$version"'",\n "date": "'"$date"'",\n "changes": [\n "New release"\n ]\n },' js/versions.js
echo "Updated content of js/versions.js:"
cat js/versions.js
- name: Commit and push if changed
run: |
git config --global user.name 'GitHub Action'
git config --global user.email '[email protected]'
git add js/versions.js
git status
git diff --cached
git commit -m "Update version to $version" || echo "No changes to commit"
git push || echo "No changes to push"