CRITICAL FIXES: - Fix tag parsing in workflow to strip "astrolabe-v" instead of "v" For tag astrolabe-v0.1.0, now correctly extracts "0.1.0" - Add workflow filtering to only run on astrolabe-v* tags Prevents wasting CI resources on MCP/Helm releases RECOMMENDED IMPROVEMENTS: - Make Nextcloud server path configurable in Makefile Can now override: make appstore server_dir=/path/to/server - Add dependency validation to Makefile Checks for composer, npm, php before building - Add signing prerequisite validation Verifies server/occ, private key, and certificate exist - Add dependency checks to all bump scripts Validates uv is installed before running cz bump These changes improve local build experience and prevent common errors with clear error messages and installation guidance.
87 lines
2.8 KiB
YAML
87 lines
2.8 KiB
YAML
name: Build and Publish Astrolabe App Release
|
|
|
|
on:
|
|
release:
|
|
types: [published]
|
|
|
|
env:
|
|
APP_NAME: astrolabe
|
|
APP_DIR: third_party/astrolabe
|
|
|
|
jobs:
|
|
build-and-publish:
|
|
runs-on: ubuntu-latest
|
|
# Only run on Astrolabe releases
|
|
if: startsWith(github.ref, 'refs/tags/astrolabe-v')
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Get version from tag
|
|
id: tag
|
|
run: |
|
|
echo "TAG=${GITHUB_REF#refs/tags/astrolabe-v}" >> $GITHUB_OUTPUT
|
|
|
|
- name: Validate version in info.xml matches tag
|
|
working-directory: ${{ env.APP_DIR }}
|
|
run: |
|
|
INFO_VERSION=$(sed -n 's/.*<version>\(.*\)<\/version>.*/\1/p' appinfo/info.xml | tr -d '\t')
|
|
if [ "$INFO_VERSION" != "${{ steps.tag.outputs.TAG }}" ]; then
|
|
echo "Version mismatch: info.xml has $INFO_VERSION but tag is ${{ steps.tag.outputs.TAG }}"
|
|
exit 1
|
|
fi
|
|
echo "Version validated: $INFO_VERSION"
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
|
|
- name: Setup PHP
|
|
uses: shivammathur/setup-php@v2
|
|
with:
|
|
php-version: 8.1
|
|
coverage: none
|
|
|
|
- name: Checkout Nextcloud server (for signing)
|
|
uses: actions/checkout@v4
|
|
with:
|
|
repository: nextcloud/server
|
|
ref: stable30
|
|
path: server
|
|
|
|
- name: Install dependencies and build
|
|
working-directory: ${{ env.APP_DIR }}
|
|
run: |
|
|
composer install --no-dev --optimize-autoloader
|
|
npm ci
|
|
npm run build
|
|
|
|
- name: Setup signing certificate
|
|
run: |
|
|
mkdir -p $HOME/.nextcloud/certificates
|
|
echo "${{ secrets.APP_PRIVATE_KEY }}" > $HOME/.nextcloud/certificates/${{ env.APP_NAME }}.key
|
|
echo "${{ secrets.APP_PUBLIC_CRT }}" > $HOME/.nextcloud/certificates/${{ env.APP_NAME }}.crt
|
|
|
|
- name: Build app store package
|
|
working-directory: ${{ env.APP_DIR }}
|
|
run: make appstore
|
|
|
|
- name: Attach tarball to GitHub release
|
|
uses: svenstaro/upload-release-action@v2
|
|
with:
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
file: ${{ env.APP_DIR }}/build/artifacts/${{ env.APP_NAME }}.tar.gz
|
|
asset_name: ${{ env.APP_NAME }}-${{ steps.tag.outputs.TAG }}.tar.gz
|
|
tag: ${{ github.ref }}
|
|
|
|
- name: Upload to Nextcloud App Store
|
|
uses: R0Wi/nextcloud-appstore-push-action@v1.0.6
|
|
with:
|
|
app_name: ${{ env.APP_NAME }}
|
|
appstore_token: ${{ secrets.APPSTORE_TOKEN }}
|
|
download_url: ${{ github.server_url }}/${{ github.repository }}/releases/download/${{ github.ref_name }}/${{ env.APP_NAME }}-${{ steps.tag.outputs.TAG }}.tar.gz
|
|
app_private_key: ${{ secrets.APP_PRIVATE_KEY }}
|
|
nightly: ${{ github.event.release.prerelease }}
|