Update used actions and cleanup release flow

This commit is contained in:
Philipp David 2022-03-23 13:33:18 +01:00
parent 51de84407f
commit 471ea680a5
No known key found for this signature in database
GPG Key ID: 967A5D5EB5071577
3 changed files with 44 additions and 90 deletions

View File

@ -9,7 +9,9 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: checkout - name: checkout
uses: actions/checkout@v1 uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Backport PR by cherry-pick-ing - name: Backport PR by cherry-pick-ing
uses: Nathanmalnoury/gh-backport-action@master uses: Nathanmalnoury/gh-backport-action@master
with: with:

View File

@ -58,7 +58,7 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v3
with: with:
submodules: 'true' submodules: 'true'
@ -91,7 +91,7 @@ jobs:
- name: Cache Qt - name: Cache Qt
if: runner.os != 'Windows' if: runner.os != 'Windows'
id: cache-qt id: cache-qt
uses: actions/cache@v2 uses: actions/cache@v3
with: with:
path: "${{ github.workspace }}/Qt/" path: "${{ github.workspace }}/Qt/"
key: ${{ runner.os }}-${{ matrix.qt_version }}-${{ matrix.qt_arch }}-qt_cache key: ${{ runner.os }}-${{ matrix.qt_version }}-${{ matrix.qt_arch }}-qt_cache
@ -226,14 +226,14 @@ jobs:
- name: Upload Linux tar.gz - name: Upload Linux tar.gz
if: runner.os == 'Linux' && matrix.app_image != true if: runner.os == 'Linux' && matrix.app_image != true
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v3
with: with:
name: PolyMC-${{ runner.os }}-${{ env.VERSION }}-${{ inputs.build_type }} name: PolyMC-${{ runner.os }}-${{ env.VERSION }}-${{ inputs.build_type }}
path: PolyMC.tar.gz path: PolyMC.tar.gz
- name: Upload AppImage for Linux - name: Upload AppImage for Linux
if: matrix.app_image == true if: matrix.app_image == true
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v3
with: with:
name: PolyMC-${{ runner.os }}-${{ env.VERSION }}-${{ inputs.build_type }}-x86_64.AppImage name: PolyMC-${{ runner.os }}-${{ env.VERSION }}-${{ inputs.build_type }}-x86_64.AppImage
path: PolyMC-${{ runner.os }}-${{ env.VERSION }}-${{ inputs.build_type }}-x86_64.AppImage path: PolyMC-${{ runner.os }}-${{ env.VERSION }}-${{ inputs.build_type }}-x86_64.AppImage
@ -254,14 +254,14 @@ jobs:
- name: Upload package for Windows - name: Upload package for Windows
if: runner.os == 'Windows' if: runner.os == 'Windows'
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v3
with: with:
name: PolyMC-${{ matrix.name }}-${{ env.VERSION }}-${{ inputs.build_type }} name: PolyMC-${{ matrix.name }}-${{ env.VERSION }}-${{ inputs.build_type }}
path: ${{ env.INSTALL_DIR }}/** path: ${{ env.INSTALL_DIR }}/**
- name: Upload package for macOS - name: Upload package for macOS
if: runner.os == 'macOS' if: runner.os == 'macOS'
uses: actions/upload-artifact@v2 uses: actions/upload-artifact@v3
with: with:
name: PolyMC-${{ runner.os }}-${{ env.VERSION }}-${{ inputs.build_type }} name: PolyMC-${{ runner.os }}-${{ env.VERSION }}-${{ inputs.build_type }}
path: PolyMC.tar.gz path: PolyMC.tar.gz

View File

@ -19,10 +19,36 @@ jobs:
outputs: outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }} upload_url: ${{ steps.create_release.outputs.upload_url }}
steps: steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: 'true'
path: 'PolyMC-source'
- name: Download artifacts
uses: actions/download-artifact@v3
- name: Grab and store version - name: Grab and store version
run: | run: |
tag_name=$(echo ${{ github.ref }} | grep -oE "[^/]+$") tag_name=$(echo ${{ github.ref }} | grep -oE "[^/]+$")
echo "VERSION=$tag_name" >> $GITHUB_ENV echo "VERSION=$tag_name" >> $GITHUB_ENV
- name: Package artifacts properly
run: |
mv ${{ github.workspace }}/PolyMC-source PolyMC-${{ env.VERSION }}
mv PolyMC-Linux*/PolyMC.tar.gz PolyMC-Linux-${{ env.VERSION }}.tar.gz
mv PolyMC-*.AppImage/PolyMC-*.AppImage PolyMC-Linux-${{ env.VERSION }}-x86_64.AppImage
mv PolyMC-macOS*/PolyMC.tar.gz PolyMC-macOS-${{ env.VERSION }}.tar.gz
tar -czf PolyMC-${{ env.VERSION }}.tar.gz PolyMC-${{ env.VERSION }}
for d in PolyMC-Windows-*; do
cd "${d}" || continue
ARCH="$(echo -n ${d} | cut -d '-' -f 3)"
PORT="$(echo -n ${d} | grep -o portable || true)"
NAME="PolyMC-Windows-${ARCH}"
test -z "${PORT}" || NAME="${NAME}-portable"
zip -r -9 "../${NAME}-${{ env.VERSION }}.zip" *
cd ..
done
- name: Create release - name: Create release
id: create_release id: create_release
uses: softprops/action-gh-release@v1 uses: softprops/action-gh-release@v1
@ -33,86 +59,12 @@ jobs:
name: PolyMC ${{ env.VERSION }} name: PolyMC ${{ env.VERSION }}
draft: true draft: true
prerelease: false prerelease: false
files: |
upload_release: PolyMC-Linux-${{ env.VERSION }}.tar.gz
needs: create_release PolyMC-Linux-${{ env.VERSION }}-x86_64.AppImage
runs-on: ubuntu-latest PolyMC-Windows-i686-${{ env.VERSION }}.zip
steps: PolyMC-Windows-i686-portable-${{ env.VERSION }}.zip
PolyMC-Windows-x86_64-${{ env.VERSION }}.zip
- name: Checkout PolyMC-Windows-x86_64-portable-${{ env.VERSION }}.zip
uses: actions/checkout@v2 PolyMC-macOS-${{ env.VERSION }}.tar.gz
with: PolyMC-${{ env.VERSION }}.tar.gz
submodules: 'true'
path: 'PolyMC-source'
- name: Download artifacts
uses: actions/download-artifact@v2
- name: Grab and store version
run: |
tag_name=$(echo ${{ github.ref }} | grep -oE "[^/]+$")
echo "VERSION=$tag_name" >> $GITHUB_ENV
- name: Package artifacts properly
run: |
mv ${{ github.workspace }}/PolyMC-source PolyMC-${{ env.VERSION }}
mv PolyMC-Linux*/PolyMC.tar.gz PolyMC-Linux-${{ env.VERSION }}.tar.gz
mv PolyMC-*.AppImage/PolyMC-*.AppImage PolyMC-Linux-${{ env.VERSION }}-x86_64.AppImage
mv PolyMC-Windows* PolyMC-Windows-${{ env.VERSION }}
mv PolyMC-macOS*/PolyMC.tar.gz PolyMC-macOS-${{ env.VERSION }}.tar.gz
tar -czf PolyMC-${{ env.VERSION }}.tar.gz PolyMC-${{ env.VERSION }}
cd PolyMC-Windows-${{ env.VERSION }}
zip -r -9 ../PolyMC-Windows-${{ env.VERSION }}.zip *
cd ..
- name: Upload Linux asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_name: PolyMC-Linux-${{ env.VERSION }}.tar.gz
asset_path: PolyMC-Linux-${{ env.VERSION }}.tar.gz
asset_content_type: application/gzip
- name: Upload Linux AppImage asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_name: PolyMC-Linux-${{ env.VERSION }}-x86_64.AppImage
asset_path: PolyMC-Linux-${{ env.VERSION }}-x86_64.AppImage
asset_content_type: application/x-executable
- name: Upload Windows asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_name: PolyMC-Windows-${{ env.VERSION }}.zip
asset_path: PolyMC-Windows-${{ env.VERSION }}.zip
asset_content_type: application/zip
- name: Upload macOS asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_name: PolyMC-macOS-${{ env.VERSION }}.tar.gz
asset_path: PolyMC-macOS-${{ env.VERSION }}.tar.gz
asset_content_type: application/gzip
- name: Upload vendored source tarball
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_name: PolyMC-${{ env.VERSION }}.tar.gz
asset_path: PolyMC-${{ env.VERSION }}.tar.gz
asset_content_type: application/gzip