2022-02-21 15:26:05 +00:00
|
|
|
name: Build Application and Make Release
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- '*'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
|
|
|
build_release:
|
|
|
|
name: Build Release
|
|
|
|
uses: ./.github/workflows/build.yml
|
|
|
|
with:
|
|
|
|
build_type: Release
|
2022-07-13 20:42:25 +00:00
|
|
|
secrets:
|
|
|
|
SPARKLE_ED25519_KEY: ${{ secrets.SPARKLE_ED25519_KEY }}
|
2022-02-21 15:26:05 +00:00
|
|
|
|
|
|
|
create_release:
|
|
|
|
needs: build_release
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
|
|
steps:
|
2022-03-23 10:36:28 +00:00
|
|
|
- name: Checkout
|
2022-03-23 12:33:18 +00:00
|
|
|
uses: actions/checkout@v3
|
2022-03-23 10:36:28 +00:00
|
|
|
with:
|
|
|
|
submodules: 'true'
|
|
|
|
path: 'PolyMC-source'
|
2022-02-21 15:26:05 +00:00
|
|
|
- name: Download artifacts
|
2022-03-23 12:33:18 +00:00
|
|
|
uses: actions/download-artifact@v3
|
2022-02-21 15:26:05 +00:00
|
|
|
- name: Grab and store version
|
|
|
|
run: |
|
|
|
|
tag_name=$(echo ${{ github.ref }} | grep -oE "[^/]+$")
|
|
|
|
echo "VERSION=$tag_name" >> $GITHUB_ENV
|
|
|
|
- name: Package artifacts properly
|
|
|
|
run: |
|
2022-03-23 10:36:28 +00:00
|
|
|
mv ${{ github.workspace }}/PolyMC-source PolyMC-${{ env.VERSION }}
|
2022-04-19 17:06:17 +00:00
|
|
|
mv PolyMC-Linux-Portable*/PolyMC-portable.tar.gz PolyMC-Linux-Portable-${{ env.VERSION }}.tar.gz
|
2022-02-21 15:26:05 +00:00
|
|
|
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
|
|
|
|
|
2022-03-23 10:36:28 +00:00
|
|
|
tar -czf PolyMC-${{ env.VERSION }}.tar.gz PolyMC-${{ env.VERSION }}
|
|
|
|
|
2022-03-23 12:33:18 +00:00
|
|
|
for d in PolyMC-Windows-*; do
|
|
|
|
cd "${d}" || continue
|
2022-07-09 06:59:43 +00:00
|
|
|
LEGACY="$(echo -n ${d} | grep -o Legacy || true)"
|
2022-05-20 21:09:26 +00:00
|
|
|
INST="$(echo -n ${d} | grep -o Setup || true)"
|
2022-04-17 22:41:43 +00:00
|
|
|
PORT="$(echo -n ${d} | grep -o Portable || true)"
|
2022-07-09 16:56:32 +00:00
|
|
|
NAME="PolyMC-Windows"
|
2022-07-09 06:59:43 +00:00
|
|
|
test -z "${LEGACY}" || NAME="${NAME}-Legacy"
|
2022-04-17 22:41:43 +00:00
|
|
|
test -z "${PORT}" || NAME="${NAME}-Portable"
|
2022-05-20 21:09:26 +00:00
|
|
|
test -z "${INST}" || mv PolyMC-*.exe ../${NAME}-Setup-${{ env.VERSION }}.exe
|
|
|
|
test -n "${INST}" || zip -r -9 "../${NAME}-${{ env.VERSION }}.zip" *
|
2022-03-23 12:33:18 +00:00
|
|
|
cd ..
|
|
|
|
done
|
2022-02-21 15:26:05 +00:00
|
|
|
|
2022-03-23 12:33:18 +00:00
|
|
|
- name: Create release
|
|
|
|
id: create_release
|
|
|
|
uses: softprops/action-gh-release@v1
|
2022-03-23 10:36:28 +00:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
2022-03-23 12:33:18 +00:00
|
|
|
tag_name: ${{ github.ref }}
|
|
|
|
name: PolyMC ${{ env.VERSION }}
|
|
|
|
draft: true
|
|
|
|
prerelease: false
|
|
|
|
files: |
|
|
|
|
PolyMC-Linux-${{ env.VERSION }}.tar.gz
|
2022-04-17 22:41:43 +00:00
|
|
|
PolyMC-Linux-Portable-${{ env.VERSION }}.tar.gz
|
2022-03-23 12:33:18 +00:00
|
|
|
PolyMC-Linux-${{ env.VERSION }}-x86_64.AppImage
|
2022-07-13 20:42:25 +00:00
|
|
|
PolyMC-Windows-Legacy-${{ env.VERSION }}.zip
|
|
|
|
PolyMC-Windows-Legacy-Portable-${{ env.VERSION }}.zip
|
|
|
|
PolyMC-Windows-Legacy-Setup-${{ env.VERSION }}.exe
|
|
|
|
PolyMC-Windows-${{ env.VERSION }}.zip
|
|
|
|
PolyMC-Windows-Portable-${{ env.VERSION }}.zip
|
|
|
|
PolyMC-Windows-Setup-${{ env.VERSION }}.exe
|
2022-03-23 12:33:18 +00:00
|
|
|
PolyMC-macOS-${{ env.VERSION }}.tar.gz
|
|
|
|
PolyMC-${{ env.VERSION }}.tar.gz
|