diff --git a/README.md b/README.md deleted file mode 100644 index abc4f59..0000000 --- a/README.md +++ /dev/null @@ -1,196 +0,0 @@ -name: Release Workflow - -on: - push: - branches: - - master - - main - workflow_dispatch: - inputs: - version: - description: 'Version to release (leave empty to use info.xml version)' - required: false - default: '' - -jobs: - release-management: - runs-on: ubuntu-latest - steps: - - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Set app env - run: | - echo "APP_NAME=${GITHUB_REPOSITORY##*/}" >> $GITHUB_ENV - - - name: Get current version and increment - id: increment_version - run: | - current_version=$(grep -oP '(?<=)[^<]+' appinfo/info.xml) - IFS='.' read -ra version_parts <<< "$current_version" - ((version_parts[2]++)) - new_version="${version_parts[0]}.${version_parts[1]}.${version_parts[2]}" - echo "NEW_VERSION=$new_version" >> $GITHUB_ENV - echo "new_version=$new_version" >> $GITHUB_OUTPUT - - - name: Update version in info.xml - run: | - sed -i "s|.*|${{ env.NEW_VERSION }}|" appinfo/info.xml - - - name: Commit version update - run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git commit -am "Bump version to ${{ env.NEW_VERSION }}" - git push - - # Step 1: Prepare the signing certificate and key - - name: Prepare Signing Certificate and Key - run: | - echo "${{ secrets.NEXTCLOUD_SIGNING_CERT }}" > signing-cert.crt - echo "${{ secrets.NEXTCLOUD_SIGNING_KEY }}" > signing-key.key - - # Step 3: Install Node.js dependencies using npm - - name: Install npm dependencies - uses: actions/setup-node@v3 - with: - node-version: '18.x' # Specify Node.js version - - # Step 4: Install PHP extensions - - name: Set up PHP and install extensions - uses: shivammathur/setup-php@v2 - with: - php-version: '8.2' - extensions: zip, gd - - # Step 5: Build the node dependencies - - run: npm ci - - # Step 6: Build the node dependencies - - run: npm run build - - # Step 7: Build composer dependencies - - run: composer i --no-dev - - # Step 8: Copy the files into the package directory - - name: Copy the package files into the package - run: | - mkdir -p package/${{ github.event.repository.name }} - rsync -av --progress \ - --exclude='package' \ - --exclude='.git' \ - --exclude='.github' \ - --exclude='.vscode' \ - --exclude='docker' \ - --exclude='docs' \ - --exclude='node_modules' \ - --exclude='/src' \ - --exclude='test' \ - --exclude='package-lock.json' \ - --exclude='composer.lock' \ - --exclude='composer-setup.php' \ - --exclude='.phpunit.result.cache' \ - --exclude='phpmd.xml' \ - --exclude='signing-key.key' \ - --exclude='package.json' \ - --exclude='composer.json' \ - --exclude='coverage.txt' \ - --exclude='signing-cert.crt' \ - --exclude='docker-compose.yml' \ - --exclude='webpack.config.js' \ - --exclude='.prettierrc' \ - --exclude='psalm.xml' \ - --exclude='phpunit.xml' \ - --exclude='tsconfig.json' \ - --exclude='changelog-ci-config.json' \ - --exclude='jest.config.js' \ - --exclude='.gitattributes' \ - --exclude='.php-cs-fixer.dist.php' \ - --exclude='.gitignore' \ - --exclude='.eslintrc.js' \ - --exclude='stylelint.config.js' \ - --exclude='.babelrc' \ - --exclude='.nvmrc' \ - ./ package/${{ github.event.repository.name }}/ - - # Step 9: Create the TAR.GZ archive - - name: Create Tarball - run: | - cd package && tar -czf ../nextcloud-release.tar.gz ${{ github.event.repository.name }} - - # Step 10: Sign the TAR.GZ file with OpenSSL - - name: Sign the TAR.GZ file with OpenSSL - run: | - openssl dgst -sha512 -sign signing-key.key nextcloud-release.tar.gz | openssl base64 -out nextcloud-release.signature - - # Step 11: Generate Git version information - - name: Git Version - id: version - uses: codacy/git-version@2.7.1 - with: - release-branch: main - - # Step 12: Extract repository description - - name: Extract repository description - id: repo-description - run: | - description=$(jq -r '.description' <(curl -s https://api.github.com/repos/${{ github.repository }})) - echo "REPO_DESCRIPTION=$description" >> $GITHUB_ENV - - # Step 13: Run Changelog CI - - name: Run Changelog CI - if: github.ref == 'refs/heads/main' - uses: saadmk11/changelog-ci@v1.1.2 - with: - release_version: ${{ env.NEW_VERSION }} - config_file: changelog-ci-config.json - - # Step 14: Output the version - - name: Use the version - run: | - echo ${{ steps.version.outputs.version }} - - # Step 15: Copy the package files into the package (this step seems redundant, consider removing) - - name: Copy the package files into the package - run: | - mkdir -p package/${{ github.event.repository.name }} - rsync -av --progress --exclude='package' --exclude='.git' ./ package/${{ github.event.repository.name }}/ - - # Step 18: Create a new release on GitHub - - name: Upload Release - uses: ncipollo/release-action@v1.12.0 - with: - tag: v${{ env.NEW_VERSION }} - name: Release ${{ env.NEW_VERSION }} - draft: false - prerelease: false - - - name: Attach tarball to github release - uses: svenstaro/upload-release-action@04733e069f2d7f7f0b4aebc4fbdbce8613b03ccd # v2 - id: attach_to_release - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: nextcloud-release.tar.gz # Corrected spelling - asset_name: ${{ env.APP_NAME }}-${{ env.NEW_VERSION }}.tar.gz - tag: v${{ env.NEW_VERSION }} - overwrite: true - - - name: Upload app to Nextcloud appstore - uses: nextcloud-releases/nextcloud-appstore-push-action@a011fe619bcf6e77ddebc96f9908e1af4071b9c1 # v1 - with: - app_name: ${{ env.APP_NAME }} - appstore_token: ${{ secrets.NEXTCLOUD_APPSTORE_TOKEN }} - download_url: https://github.com/${{ github.repository }}/releases/download/v${{ env.NEW_VERSION }}/${{ env.APP_NAME }}-${{ env.NEW_VERSION }}.tar.gz - app_private_key: ${{ secrets.NEXTCLOUD_SIGNING_KEY }} - nightly: false - - - name: Verify version and contents - run: | - echo "App version: ${{ env.NEW_VERSION }}" - echo "Tarball contents:" - tar -tvf nextcloud-release.tar.gz - echo "info.xml contents:" - tar -xOf nextcloud-release.tar.gz ${{ env.APP_NAME }}/appinfo/info.xml \ No newline at end of file diff --git a/nextcloud-app-build-action/LICENSE b/nextcloud-app-build-action/LICENSE deleted file mode 100644 index e69de29..0000000 diff --git a/nextcloud-app-build-action/README.md b/nextcloud-app-build-action/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/nextcloud-app-build-action/action.yml b/nextcloud-app-build-action/action.yml deleted file mode 100644 index 6e980fb..0000000 --- a/nextcloud-app-build-action/action.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: 'Nextcloud App Build' -description: 'Builds the Nextcloud app' -runs: - using: "composite" - steps: - - name: Set up Node.js - uses: actions/setup-node@v3 - with: - node-version: '18.x' - - - name: Set up PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '8.2' - extensions: zip, gd - - - name: Install npm dependencies - shell: bash - run: npm ci - - - name: Build npm - shell: bash - run: npm run build - - - name: Install Composer dependencies - shell: bash - run: composer install --no-dev diff --git a/nextcloud-app-package-action/LICENSE b/nextcloud-app-package-action/LICENSE deleted file mode 100644 index e69de29..0000000 diff --git a/nextcloud-app-package-action/README.md b/nextcloud-app-package-action/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/nextcloud-app-package-action/action.yml b/nextcloud-app-package-action/action.yml deleted file mode 100644 index 75fe058..0000000 --- a/nextcloud-app-package-action/action.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: 'Nextcloud App Package' -description: 'Packages the Nextcloud app' -inputs: - app_name: - description: 'Name of the Nextcloud app' - required: true -runs: - using: "composite" - steps: - - name: Copy files to package directory - shell: bash - run: | - mkdir -p package/${{ inputs.app_name }} - rsync -av --progress \ - --exclude='package' \ - --exclude='.git' \ - --exclude='.github' \ - --exclude='.vscode' \ - --exclude='docker' \ - --exclude='docs' \ - --exclude='node_modules' \ - --exclude='/src' \ - --exclude='test' \ - --exclude='package-lock.json' \ - --exclude='composer.lock' \ - --exclude='composer-setup.php' \ - --exclude='.phpunit.result.cache' \ - --exclude='phpmd.xml' \ - --exclude='signing-key.key' \ - --exclude='package.json' \ - --exclude='composer.json' \ - --exclude='coverage.txt' \ - --exclude='signing-cert.crt' \ - --exclude='docker-compose.yml' \ - --exclude='webpack.config.js' \ - --exclude='.prettierrc' \ - --exclude='psalm.xml' \ - --exclude='phpunit.xml' \ - --exclude='tsconfig.json' \ - --exclude='changelog-ci-config.json' \ - --exclude='jest.config.js' \ - --exclude='.gitattributes' \ - --exclude='.php-cs-fixer.dist.php' \ - --exclude='.gitignore' \ - --exclude='.eslintrc.js' \ - --exclude='stylelint.config.js' \ - --exclude='.babelrc' \ - --exclude='.nvmrc' \ - ./ package/${{ inputs.app_name }}/ - - - name: Create tarball - shell: bash - run: | - cd package && tar -czf ../nextcloud-release.tar.gz ${{ inputs.app_name }} diff --git a/nextcloud-app-release-action/LICENSE b/nextcloud-app-release-action/LICENSE deleted file mode 100644 index e69de29..0000000 diff --git a/nextcloud-app-release-action/README.md b/nextcloud-app-release-action/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/nextcloud-app-release-action/action.yml b/nextcloud-app-release-action/action.yml deleted file mode 100644 index 85cabc2..0000000 --- a/nextcloud-app-release-action/action.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: 'Nextcloud App Release Action' -description: 'Automates the release process for Nextcloud apps' -inputs: - app_name: - description: 'Name of the Nextcloud app' - required: true - signing_cert: - description: 'Signing certificate' - required: true - signing_key: - description: 'Signing key' - required: true - appstore_token: - description: 'Nextcloud App Store token' - required: true - github_token: - description: 'GitHub token for creating releases' - required: true - -runs: - using: "composite" - steps: - - name: Checkout Code - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Version Management - uses: your-org/nextcloud-app-version-action@v1 - id: version - - - name: Build - uses: your-org/nextcloud-app-build-action@v1 - - - name: Package - uses: your-org/nextcloud-app-package-action@v1 - with: - app_name: ${{ inputs.app_name }} - - - name: Sign - uses: your-org/nextcloud-app-sign-action@v1 - with: - signing_cert: ${{ inputs.signing_cert }} - signing_key: ${{ inputs.signing_key }} - - - name: Release - uses: your-org/nextcloud-app-release-action@v1 - with: - github_token: ${{ inputs.github_token }} - version: ${{ steps.version.outputs.new_version }} - app_name: ${{ inputs.app_name }} - - - name: App Store Upload - uses: your-org/nextcloud-app-store-upload-action@v1 - with: - app_name: ${{ inputs.app_name }} - appstore_token: ${{ inputs.appstore_token }} - version: ${{ steps.version.outputs.new_version }} diff --git a/nextcloud-app-sign-action/LICENSE b/nextcloud-app-sign-action/LICENSE deleted file mode 100644 index e69de29..0000000 diff --git a/nextcloud-app-sign-action/README.md b/nextcloud-app-sign-action/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/nextcloud-app-sign-action/action.yml b/nextcloud-app-sign-action/action.yml deleted file mode 100644 index 6dbd8e1..0000000 --- a/nextcloud-app-sign-action/action.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: 'Nextcloud App Sign' -description: 'Signs the Nextcloud app package' -inputs: - signing_cert: - description: 'Signing certificate' - required: true - signing_key: - description: 'Signing key' - required: true -runs: - using: "composite" - steps: - - name: Prepare Signing Certificate and Key - shell: bash - run: | - echo "${{ inputs.signing_cert }}" > signing-cert.crt - echo "${{ inputs.signing_key }}" > signing-key.key - - - name: Sign the TAR.GZ file - shell: bash - run: | - openssl dgst -sha512 -sign signing-key.key nextcloud-release.tar.gz | openssl base64 -out nextcloud-release.signature diff --git a/nextcloud-app-store-upload-action/LICENSE b/nextcloud-app-store-upload-action/LICENSE deleted file mode 100644 index e69de29..0000000 diff --git a/nextcloud-app-store-upload-action/README.md b/nextcloud-app-store-upload-action/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/nextcloud-app-store-upload-action/action.yml b/nextcloud-app-store-upload-action/action.yml deleted file mode 100644 index e2df7ad..0000000 --- a/nextcloud-app-store-upload-action/action.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: 'Nextcloud App Store Upload' -description: 'Uploads the Nextcloud app to the App Store' -inputs: - app_name: - description: 'Name of the Nextcloud app' - required: true - appstore_token: - description: 'Nextcloud App Store token' - required: true - version: - description: 'Version to upload' - required: true -runs: - using: "composite" - steps: - - name: Upload app to Nextcloud appstore - uses: nextcloud-releases/nextcloud-appstore-push-action@v1 - with: - app_name: ${{ inputs.app_name }} - appstore_token: ${{ inputs.appstore_token }} - download_url: https://github.com/${{ github.repository }}/releases/download/v${{ inputs.version }}/${{ inputs.app_name }}-${{ inputs.version }}.tar.gz - app_private_key: ${{ inputs.signing_key }} - nightly: false diff --git a/nextcloud-app-version-action/LICENSE b/nextcloud-app-version-action/LICENSE deleted file mode 100644 index e69de29..0000000 diff --git a/nextcloud-app-version-action/README.md b/nextcloud-app-version-action/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/nextcloud-app-version-action/action.yml b/nextcloud-app-version-action/action.yml deleted file mode 100644 index 0846be0..0000000 --- a/nextcloud-app-version-action/action.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: 'Nextcloud App Version Management' -description: 'Manages version for Nextcloud apps' -outputs: - new_version: - description: 'The new version number' -runs: - using: "composite" - steps: - - name: Get current version and increment - id: increment_version - shell: bash - run: | - current_version=$(grep -oP '(?<=)[^<]+' appinfo/info.xml) - IFS='.' read -ra version_parts <<< "$current_version" - ((version_parts[2]++)) - new_version="${version_parts[0]}.${version_parts[1]}.${version_parts[2]}" - echo "NEW_VERSION=$new_version" >> $GITHUB_ENV - echo "new_version=$new_version" >> $GITHUB_OUTPUT - - - name: Update version in info.xml - shell: bash - run: | - sed -i "s|.*|${{ env.NEW_VERSION }}|" appinfo/info.xml - - - name: Commit version update - shell: bash - run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git commit -am "Bump version to ${{ env.NEW_VERSION }}" - git push