From c6e5447389cc2a81cc4d4149c8bfc888ab34da16 Mon Sep 17 00:00:00 2001 From: Fabian Wolf Date: Wed, 22 Feb 2023 16:34:26 +0100 Subject: [PATCH] Rebuild to create also the release --- .github/workflows/release.yml | 68 +++++++++++++++++++++++++++-------- 1 file changed, 53 insertions(+), 15 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2ab5e865723e..37e9b5787939 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,7 +1,9 @@ -name: Pack Release Zip +name: Create Release Page on: - release: - types: [published] + push: + # Sequence of patterns matched against refs/tags + tags: + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 jobs: build: runs-on: ubuntu-latest @@ -36,19 +38,55 @@ jobs: version: 2.2.x php_extensions: zip gd xsl - name: Pack release zip - run: zip -ry ../ILIAS-${VERSION}.zip ./ + run: zip -ry ../release.zip ./ - name: Pack release tar - run: tar -zcvf ../ILIAS-${VERSION}.tar.gz ./ + run: tar -zcvf ../release.tar.gz ./ - name: MD5sum run: | - mv ../ILIAS-${VERSION}.zip . - mv ../ILIAS-${VERSION}.tar.gz . - md5sum ILIAS-${VERSION}.zip - ls -hs ILIAS-${VERSION}.zip - md5sum ILIAS-${VERSION}.tar.gz - ls -hs ILIAS-${VERSION}.tar.gz - - name: Upload artifact - uses: actions/upload-artifact@v2 + mv ../release.zip . + mv ../release.tar.gz . + md5_zip=($(md5sum release.zip)) + size_zip=($(ls -hs release.zip)) + echo "release.zip [$md5_zip]($size_zip)" + md5_tar=($(md5sum release.zip)) + size_tar=($(ls -hs release.zip)) + echo "release.tar.gz [$md5_tar]($size_tar)" + echo "MD5_ZIP=$md5_zip" >> $GITHUB_ENV + echo "SIZE_ZIP=$size_zip" >> $GITHUB_ENV + echo "MD5_TAR=$md5_tar" >> $GITHUB_ENV + echo "SIZE_TAR=$size_tar" >> $GITHUB_ENV + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.DEPLOYMENT_TOKEN }} with: - name: release-artifact - path: ILIAS-${VERSION}.* \ No newline at end of file + tag_name: ${{ github.ref }} + release_name: Release ${VERSION} + body: | + Maintenance release for ILIAS 7. + More information about the release at https://docu.ilias.de/goto_docu_lm_35.html + + Use the pre-packed files ILIAS-$VERSION.tar.gz[$MD5_TAR]($SIZE_TAR) or ILIAS-$VERSION.zip[$MD5_ZIP]($SIZE_ZIP) for download and installing ILIAS and ignore the files offered by GitHub (called 'Source Code') to prevent problems with composer. + draft: false + prerelease: false + - name: Upload Release Asset (ZIP) + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.DEPLOYMENT_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: ./release.zip + asset_name: ILIAS-${VERSION}.zip + asset_content_type: application/zip + - name: Upload Release Asset (TAR) + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: ./release.tar.gz + asset_name: ILIAS-${VERSION}.tar.gz + asset_content_type: application/x-gtar \ No newline at end of file