Skip to content

vv0.5.2

vv0.5.2 #94

Workflow file for this run

name: Release pack
on:
push:
branches:
- dev
jobs:
release:
if: startsWith(github.event.head_commit.message, 'vv')
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Check commit message
id: check_commit_message
run: |
version=$(git log --format=%B -n 1 ${{ github.sha }})
version=${version:1}
version_numeric=${version:1}
echo "VERSION=$version" >> $GITHUB_ENV
echo "VERSION_NUMERIC=$version_numeric" >> $GITHUB_ENV
echo "$VERSION" "$version"
if [[ "$version" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Commit name matches"
else
echo "Commit name doesnt match"
exit 1
fi
- name: Install dependencies
run: sudo apt update; sudo apt install npm
- name: Update package.json and ccmod.json
run: |
sed -i "s/\"version\": \".*\"/\"version\": \"${VERSION_NUMERIC}\"/" package.json ccmod.json
git add package.json ccmod.json
- name: Commit changes
run: |
git config --global user.email "${GITHUB_ACTOR_EMAIL}"
git config --global user.name "${GITHUB_ACTOR}"
git config --global --add safe.directory /github/workspaces
git commit -m "$VERSION"
git push origin HEAD:dev
- name: Create and push a new tag
run: |
git tag -a "$VERSION" -m "Version $VERSION"
git push origin "$VERSION"
- name: Run pack.sh
run: ./pack.sh
- name: Create release
id: create_release
uses: softprops/action-gh-release@v1
with:
files: |
*.ccmod
name: ${{ env.VERSION }}
tag_name: ${{ env.VERSION }}