Skip to content
48 changes: 12 additions & 36 deletions patches/nextcloud/appstore-build-publish.yml.patch
Original file line number Diff line number Diff line change
Expand Up @@ -33,52 +33,28 @@
- name: Check server download link for ${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}
run: |
NCVERSION='${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}'
@@ -183,6 +188,33 @@
@@ -183,6 +188,13 @@
cd ${{ env.APP_NAME }}/build/artifacts
tar -zcvf ${{ env.APP_NAME }}.tar.gz ${{ env.APP_NAME }}

+ - name: Set up PHP 8.3 for release-tool
+ uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2
+ with:
+ php-version: '8.3'
+ coverage: none
+
+ - id: release-tool
+ name: Setup release-tool v0.11.1
+ shell: bash
+ run: |
+ set -euo pipefail
+ base="https://github.com/LibreCodeCoop/release-tool/releases/download/v0.11.1"
+ curl --fail --silent --show-error --location "${base}/release-tool.phar" -o "${RUNNER_TEMP}/release-tool.phar"
+ curl --fail --silent --show-error --location "${base}/release-tool.phar.sha256" -o "${RUNNER_TEMP}/release-tool.phar.sha256"
+ (cd "${RUNNER_TEMP}" && sha256sum --check release-tool.phar.sha256)
+ echo "path=${RUNNER_TEMP}/release-tool.phar" >> "${GITHUB_OUTPUT}"
+
+ - name: Validate release artifact
+ shell: bash
+ env:
+ RELEASE_TOOL_PATH: ${{ steps.release-tool.outputs.path }}
+ run: >-
+ php "${RELEASE_TOOL_PATH}" artifact:validate-package
+ --artifact "${APP_NAME}/build/artifacts/${APP_NAME}.tar.gz"
+ --app-name "${APP_NAME}"
+ --expected-version "${APP_VERSION}"
+ uses: LibreCodeCoop/release-tool/actions/artifact-validate@710c4c83fba47bf01713f46e9c4cb4cf63debfba
+ with:
+ artifact: ${{ env.APP_NAME }}/build/artifacts/${{ env.APP_NAME }}.tar.gz
+ app-name: ${{ env.APP_NAME }}
+ version: ${{ env.APP_VERSION }}
+
- name: Attach tarball to github release
uses: svenstaro/upload-release-action@29e53e917877a24fad85510ded594ab3c9ca12de # 2.11.5
id: attach_to_release
@@ -200,3 +232,14 @@
@@ -200,3 +212,10 @@
appstore_token: ${{ secrets.APPSTORE_TOKEN }}
download_url: ${{ steps.attach_to_release.outputs.browser_download_url }}
app_private_key: ${{ secrets.APP_PRIVATE_KEY }}
+
+ - name: Verify App Store publication
+ shell: bash
+ env:
+ RELEASE_TOOL_PATH: ${{ steps.release-tool.outputs.path }}
+ NEXTCLOUD_PLATFORM: ${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}
+ run: >-
+ php "${RELEASE_TOOL_PATH}" publication:wait-appstore
+ --app-name "${APP_NAME}"
+ --version "${APP_VERSION}"
+ --platform "${NEXTCLOUD_PLATFORM}"
+ uses: LibreCodeCoop/release-tool/actions/appstore-publication-wait@710c4c83fba47bf01713f46e9c4cb4cf63debfba
+ with:
+ app-name: ${{ env.APP_NAME }}
+ version: ${{ env.APP_VERSION }}
+ platform: ${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}
44 changes: 10 additions & 34 deletions workflow-templates/appstore-build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -188,32 +188,12 @@ jobs:
cd ${{ env.APP_NAME }}/build/artifacts
tar -zcvf ${{ env.APP_NAME }}.tar.gz ${{ env.APP_NAME }}

- name: Set up PHP 8.3 for release-tool
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2
with:
php-version: '8.3'
coverage: none

- id: release-tool
name: Setup release-tool v0.11.1
shell: bash
run: |
set -euo pipefail
base="https://github.com/LibreCodeCoop/release-tool/releases/download/v0.11.1"
curl --fail --silent --show-error --location "${base}/release-tool.phar" -o "${RUNNER_TEMP}/release-tool.phar"
curl --fail --silent --show-error --location "${base}/release-tool.phar.sha256" -o "${RUNNER_TEMP}/release-tool.phar.sha256"
(cd "${RUNNER_TEMP}" && sha256sum --check release-tool.phar.sha256)
echo "path=${RUNNER_TEMP}/release-tool.phar" >> "${GITHUB_OUTPUT}"

- name: Validate release artifact
shell: bash
env:
RELEASE_TOOL_PATH: ${{ steps.release-tool.outputs.path }}
run: >-
php "${RELEASE_TOOL_PATH}" artifact:validate-package
--artifact "${APP_NAME}/build/artifacts/${APP_NAME}.tar.gz"
--app-name "${APP_NAME}"
--expected-version "${APP_VERSION}"
uses: LibreCodeCoop/release-tool/actions/artifact-validate@710c4c83fba47bf01713f46e9c4cb4cf63debfba
with:
artifact: ${{ env.APP_NAME }}/build/artifacts/${{ env.APP_NAME }}.tar.gz
app-name: ${{ env.APP_NAME }}
version: ${{ env.APP_VERSION }}

- name: Attach tarball to github release
uses: svenstaro/upload-release-action@29e53e917877a24fad85510ded594ab3c9ca12de # 2.11.5
Expand All @@ -234,12 +214,8 @@ jobs:
app_private_key: ${{ secrets.APP_PRIVATE_KEY }}

- name: Verify App Store publication
shell: bash
env:
RELEASE_TOOL_PATH: ${{ steps.release-tool.outputs.path }}
NEXTCLOUD_PLATFORM: ${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}
run: >-
php "${RELEASE_TOOL_PATH}" publication:wait-appstore
--app-name "${APP_NAME}"
--version "${APP_VERSION}"
--platform "${NEXTCLOUD_PLATFORM}"
uses: LibreCodeCoop/release-tool/actions/appstore-publication-wait@710c4c83fba47bf01713f46e9c4cb4cf63debfba
with:
app-name: ${{ env.APP_NAME }}
version: ${{ env.APP_VERSION }}
platform: ${{ fromJSON(steps.appinfo.outputs.result).nextcloud.min-version }}
78 changes: 14 additions & 64 deletions workflow-templates/nightly-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,11 @@ jobs:
latest-branch: ${{ steps.stable.outputs.latest-branch }}
latest-major: ${{ steps.stable.outputs.latest-major }}
steps:
- id: release-tool
name: Setup release-tool v0.11.0
shell: bash
run: |
set -euo pipefail
base="https://github.com/LibreCodeCoop/release-tool/releases/download/v0.11.0"
curl --fail --silent --show-error --location "${base}/release-tool.phar" -o "${RUNNER_TEMP}/release-tool.phar"
curl --fail --silent --show-error --location "${base}/release-tool.phar.sha256" -o "${RUNNER_TEMP}/release-tool.phar.sha256"
(cd "${RUNNER_TEMP}" && sha256sum --check release-tool.phar.sha256)
echo "path=${RUNNER_TEMP}/release-tool.phar" >> "${GITHUB_OUTPUT}"

- id: stable
name: Resolve stable release line
shell: bash
env:
GITHUB_TOKEN: ${{ github.token }}
RELEASE_TOOL_PATH: ${{ steps.release-tool.outputs.path }}
run: php "${RELEASE_TOOL_PATH}" release:stable-select --repository "${GITHUB_REPOSITORY}" --branch "${GITHUB_REF_NAME}"
uses: LibreCodeCoop/release-tool/actions/stable-select@710c4c83fba47bf01713f46e9c4cb4cf63debfba
with:
github-token: ${{ github.token }}

nightly-release:
name: Build and publish nightly
Expand Down Expand Up @@ -227,32 +214,12 @@ jobs:
cd "${APP_NAME}/build/artifacts"
tar -zcf "${APP_NAME}.tar.gz" "${APP_NAME}"

- name: Set up PHP 8.3 for release-tool
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # 2.37.2
with:
php-version: '8.3'
coverage: none

- id: release-tool
name: Setup release-tool v0.11.0
shell: bash
run: |
set -euo pipefail
base="https://github.com/LibreCodeCoop/release-tool/releases/download/v0.11.0"
curl --fail --silent --show-error --location "${base}/release-tool.phar" -o "${RUNNER_TEMP}/release-tool.phar"
curl --fail --silent --show-error --location "${base}/release-tool.phar.sha256" -o "${RUNNER_TEMP}/release-tool.phar.sha256"
(cd "${RUNNER_TEMP}" && sha256sum --check release-tool.phar.sha256)
echo "path=${RUNNER_TEMP}/release-tool.phar" >> "${GITHUB_OUTPUT}"

- name: Validate release artifact
shell: bash
env:
RELEASE_TOOL_PATH: ${{ steps.release-tool.outputs.path }}
run: >-
php "${RELEASE_TOOL_PATH}" artifact:validate-package
--artifact "${APP_NAME}/build/artifacts/${APP_NAME}.tar.gz"
--app-name "${APP_NAME}"
--expected-version "${APP_VERSION}"
uses: LibreCodeCoop/release-tool/actions/artifact-validate@710c4c83fba47bf01713f46e9c4cb4cf63debfba
with:
artifact: ${{ env.APP_NAME }}/build/artifacts/${{ env.APP_NAME }}.tar.gz
app-name: ${{ env.APP_NAME }}
version: ${{ env.APP_VERSION }}

- name: Define nightly metadata
id: nightly
Expand All @@ -272,31 +239,14 @@ jobs:
gh api --method POST "repos/${GITHUB_REPOSITORY}/git/refs" -f ref='refs/tags/nightly' -f sha="${GITHUB_SHA}" >/dev/null
fi

- name: Resolve nightly release note range
id: release-note-range
working-directory: ${{ env.APP_NAME }}
shell: bash
run: |
last_tag="$(git tag --list --sort=-version:refname | grep -v '^nightly$' | head -1 || true)"
echo "from-ref=${last_tag}" >> "${GITHUB_OUTPUT}"

- name: Build nightly change list
id: release-note-changes
shell: bash
env:
RELEASE_NOTES_GITHUB_TOKEN: ${{ github.token }}
RELEASE_TOOL_PATH: ${{ steps.release-tool.outputs.path }}
NIGHTLY_BRANCH: ${{ steps.nightly.outputs.branch }}
FROM_REF: ${{ steps.release-note-range.outputs.from-ref }}
run: |
set -euo pipefail
php "${RELEASE_TOOL_PATH}" release:notes \
--repository "${GITHUB_REPOSITORY}" \
--branch "${NIGHTLY_BRANCH}" \
--working-directory "${APP_NAME}" \
--from-ref "${FROM_REF}" \
--to-ref HEAD \
--fallback-limit 10
uses: LibreCodeCoop/release-tool/actions/release-notes@710c4c83fba47bf01713f46e9c4cb4cf63debfba
with:
repository: ${{ github.repository }}
branch: ${{ steps.nightly.outputs.branch }}
working-directory: ${{ env.APP_NAME }}
github-token: ${{ github.token }}

- name: Build nightly release notes
working-directory: ${{ env.APP_NAME }}
Expand Down
6 changes: 3 additions & 3 deletions workflow-templates/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
git fetch --quiet --unshallow --prune origin "+refs/heads/${RELEASE_BRANCH}:refs/remotes/origin/${RELEASE_BRANCH}" "+refs/tags/*:refs/tags/*"

- name: Prepare release
uses: LibreCodeCoop/release-tool/actions/prepare@acfe2029cab023d65ba50c86974d936becbfccc5 # v0.11.0
uses: LibreCodeCoop/release-tool/actions/prepare@710c4c83fba47bf01713f46e9c4cb4cf63debfba
with:
branch: ${{ inputs.branch }}
ref: ${{ inputs.ref }}
Expand Down Expand Up @@ -125,7 +125,7 @@ jobs:
git fetch --quiet --unshallow --prune origin "+refs/heads/${RELEASE_BRANCH}:refs/remotes/origin/${RELEASE_BRANCH}" "+refs/tags/*:refs/tags/*"

- name: Finalize merged release
uses: LibreCodeCoop/release-tool/actions/post-merge@acfe2029cab023d65ba50c86974d936becbfccc5 # v0.11.0
uses: LibreCodeCoop/release-tool/actions/post-merge@710c4c83fba47bf01713f46e9c4cb4cf63debfba
with:
pull-request-number: ${{ github.event.pull_request.number }}
merger: ${{ github.event.pull_request.merged_by.login }}
Expand All @@ -151,7 +151,7 @@ jobs:
ref: ${{ github.event.release.tag_name }}

- name: Verify publication
uses: LibreCodeCoop/release-tool/actions/publication@acfe2029cab023d65ba50c86974d936becbfccc5 # v0.11.0
uses: LibreCodeCoop/release-tool/actions/publication@710c4c83fba47bf01713f46e9c4cb4cf63debfba
with:
github-release-id: ${{ github.event.release.id }}
config-path: .nextcloud-release.yml
Expand Down
Loading