2022-02-12 03:39:36 +00:00
|
|
|
name: Build Application
|
|
|
|
|
|
|
|
on:
|
|
|
|
[push, pull_request, workflow_dispatch]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
|
|
|
build_debug:
|
|
|
|
name: Build Debug
|
|
|
|
uses: ./.github/workflows/build.yml
|
|
|
|
with:
|
|
|
|
build_type: Debug
|
|
|
|
|
|
|
|
build_release:
|
|
|
|
name: Build Release
|
|
|
|
uses: ./.github/workflows/build.yml
|
|
|
|
with:
|
|
|
|
build_type: Release
|
|
|
|
|
|
|
|
create_release:
|
2022-02-15 09:08:26 +00:00
|
|
|
if: contains(github.base_ref, 'refs/heads/stable') && startsWith(github.ref, 'refs/tags/')
|
2022-02-12 03:39:36 +00:00
|
|
|
needs: build_release
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
|
|
steps:
|
2022-02-18 13:57:15 +00:00
|
|
|
- name: Grab and store version
|
|
|
|
run: |
|
|
|
|
tag_name=$(echo ${{ github.ref }} | grep -oE "[^/]+$")
|
|
|
|
echo "VERSION=$tag_name" >> $GITHUB_ENV
|
2022-02-12 03:39:36 +00:00
|
|
|
- name: Create release
|
|
|
|
id: create_release
|
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
tag_name: ${{ github.ref }}
|
2022-02-18 13:57:15 +00:00
|
|
|
name: PolyMC ${{ env.VERSION }}
|
2022-02-12 03:39:36 +00:00
|
|
|
draft: true
|
|
|
|
prerelease: false
|
|
|
|
|
|
|
|
upload_release:
|
|
|
|
needs: create_release
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- 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: |
|
|
|
|
rm -rf *Debug*
|
|
|
|
|
2022-02-19 19:46:43 +00:00
|
|
|
mv PolyMC-Linux*/PolyMC.tar.gz PolyMC-Linux-${{ env.VERSION }}.tar.gz
|
2022-02-12 03:39:36 +00:00
|
|
|
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
|
|
|
|
|
|
|
|
cd PolyMC-Windows-${{ env.VERSION }}
|
|
|
|
zip -r -9 ../PolyMC-Windows-${{ env.VERSION }}.zip *
|
|
|
|
cd ..
|
|
|
|
|
2022-02-19 19:46:43 +00:00
|
|
|
- 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
|
|
|
|
|
2022-02-12 03:39:36 +00:00
|
|
|
- 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
|