Skip to content

Update actions

Update actions #2

Workflow file for this run

name: Release
on:
push:
branches:
- main
pull_request:
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Needed to analyze commit history
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- name: Install dependencies
run: npm install conventional-changelog-cli @conventional-commits/conventional-recommended-bump
- name: Determine next version
id: version
run: |
echo "🔍 Running conventional-recommended-bump..."
cd ./node_modules/.bin
NEXT_VERSION=$(./conventional-recommended-bump --preset angular)
echo "✅ Calculated next version: $NEXT_VERSION"
echo "version=$NEXT_VERSION" >> $GITHUB_OUTPUT
- name: Create Git tag
if: github.ref == 'refs/heads/main'
run: git tag -a "v${{ steps.version.outputs.version }}" -m "Release v${{ steps.version.outputs.version }}"
- name: Package mod
if: github.ref == 'refs/heads/main'
run: zip -r creative-mod.zip . -x "*.git*" -x ".github/*"
- name: Create GitHub Release
id: create_release
if: github.ref == 'refs/heads/main'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.version.outputs.version }}
release_name: Release v${{ steps.version.outputs.version }}
body_path: changelog.txt
draft: false
prerelease: false
- name: Upload Release Asset
if: github.ref == 'refs/heads/main'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: creative-mod.zip
asset_name: creative-mod.zip
asset_content_type: application/zip