Skip to content

chore: bump manifest version to v1.1.0 #3

chore: bump manifest version to v1.1.0

chore: bump manifest version to v1.1.0 #3

Workflow file for this run

name: 'Release Action'
on:
push:
tags:
- 'v*'
jobs:
release-action:
name: 'Create Release'
runs-on: 'ubuntu-latest'
permissions:
contents: write
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.repository.default_branch }}
- name: Install ZIP
run: sudo apt install zip
- name: Check for web directory
id: check
run: |
if [ -d "web" ]; then
echo "has_web=true" >> $GITHUB_OUTPUT
else
echo "has_web=false" >> $GITHUB_OUTPUT
fi
- name: Install pnpm if web directory exists
if: ${{ steps.check.outputs.has_web == 'true' }}
uses: pnpm/action-setup@v4
with:
version: 10
- name: Setup node
if: ${{ steps.check.outputs.has_web == 'true' }}
uses: actions/setup-node@v4
with:
node-version: 22.x
cache: 'pnpm'
cache-dependency-path: 'web/pnpm-lock.yaml'
- name: Install dependencies
if: ${{ steps.check.outputs.has_web == 'true' }}
run: pnpm i --frozen-lockfile
working-directory: web
- name: Run build
if: ${{ steps.check.outputs.has_web == 'true' }}
run: pnpm build
working-directory: web
env:
CI: false
- name: Bundle files
run: |
shopt -s extglob
mkdir ./${{ github.event.repository.name }}
rsync -avC --exclude='.github' --exclude='.vscode' --exclude='.assets' --exclude='.git' --exclude='web' --exclude='${{ github.event.repository.name }}' ./ ./${{ github.event.repository.name }}
if [ -d "web/build" ]; then
mkdir -p ./${{ github.event.repository.name }}/web/build
cp -r web/build/* ./${{ github.event.repository.name }}/web/build/
fi
zip -r ./${{ github.event.repository.name }}.zip ./${{ github.event.repository.name }}
- name: Get App Token
uses: actions/create-github-app-token@v2
id: generate_token
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
repositories: |
${{ github.event.repository.name }}
- name: Update CHANGELOG
id: changelog
uses: solareon/changelog-action@main
continue-on-error: true
with:
token: ${{ steps.generate_token.outputs.token }}
tag: ${{ github.ref_name }}
excludeTypes: chore,docs,style
includeInvalidCommits: true
useGitmojis: false
writeToFile: false
- name: Create Release
uses: ncipollo/release-action@v1.18.0
with:
allowUpdates: true
draft: false
makeLatest: true
name: ${{ github.ref_name }}
tag: ${{ github.ref_name }}
body: ${{ steps.changelog.outputs.changes }}
artifacts: ${{ github.event.repository.name }}.zip
token: ${{ steps.generate_token.outputs.token }}
- name: Upload Release Asset to CFX Portal
run: |
response=$(curl -s -w "\n%{http_code}" -X POST ${{ secrets.CFX_API_URL }}/api/upload \
-H "${{ secrets.CFX_API_CLIENT_ID }}" \
-H "${{ secrets.CFX_API_CLIENT_SECRET }}" \
-F "file=@${{ github.event.repository.name }}.zip" \
-F "assetName=${{ github.event.repository.name }}" \
-F "version=${{ github.ref_name }}" \
-F "changelog=${{ steps.changelog.outputs.changes }}" \
-F "release_candidate=false" \
-F "delete_previous_versions=true" \
-F "createNew=true")
http_code=$(echo "$response" | tail -n1)
body=$(echo "$response" | sed '$d')
echo "Response: $body"
if [ "$http_code" -ne "200" ]; then
echo "Upload failed with status code: $http_code"
exit 1
fi
echo "✅ Successfully uploaded to CFX Portal"