Skip to content

Commit

Permalink
ci: Add files to releae assets and simplify asset collection
Browse files Browse the repository at this point in the history
  • Loading branch information
Griefed committed Aug 14, 2024
1 parent 1ce8216 commit c97bee7
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 106 deletions.
33 changes: 16 additions & 17 deletions .github/workflows/devbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,22 @@ jobs:
./gradlew build --info --full-stacktrace
./gradlew media --info --full-stacktrace
- name: Collect files
run: |
mkdir continuous
cp serverpackcreator-api/build/libs/*.jar continuous/
cp serverpackcreator-app/build/libs/*.jar continuous/
cp serverpackcreator-plugin-example/build/libs/*.jar continuous/
cp media/*.dmg continuous/
cp media/*.sh continuous/
cp media/*.exe continuous/
cp checksum.txt continuous/
- name: Generate checksum
uses: jmgilman/actions-generate-checksum@v1
with:
patterns: |
media/*.dmg
media/*.sh
media/*.exe
serverpackcreator-app/build/libs/serverpackcreator-app-dev.jar
serverpackcreator-plugin-example/build/libs/serverpackcreator-plugin-example-dev.jar
continuous/*
- name: Upload to GitHub Releases
uses: "marvinpinto/action-automatic-releases@latest"
Expand All @@ -59,20 +66,12 @@ jobs:
prerelease: true
title: "Development Build"
files: |
./checksum.txt
./media/*.dmg
./media/*.sh
./media/*.exe
./serverpackcreator-app/build/libs/serverpackcreator-app-dev.jar
./serverpackcreator-plugin-example/build/libs/serverpackcreator-plugin-example-dev.jar
continuous/*
- name: Collect files
- name: Get source archives
run: |
mkdir continuous
cp serverpackcreator-api/build/libs/*.jar continuous/
cp serverpackcreator-app/build/libs/*.jar continuous/
cp serverpackcreator-plugin-example/build/libs/*.jar continuous/
cp media/* continuous/
wget -O continuous/source.zip https://github.com/Griefed/ServerPackCreator/archive/refs/tags/continuous.zip
wget -O continuous/source.tar.gz https://github.com/Griefed/ServerPackCreator/archive/refs/tags/continuous.tar.gz
- name: Cleanup continuous
id: action-ssh
Expand Down
68 changes: 41 additions & 27 deletions .github/workflows/github-prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,29 @@ jobs:
./gradlew -Pversion="${{ needs.preparations.outputs.version }}" build --info --full-stacktrace -x :serverpackcreator-api:test -x :serverpackcreator-app:test
./gradlew -Pversion="${{ needs.preparations.outputs.version }}" media --info --full-stacktrace -x :serverpackcreator-api:test -x :serverpackcreator-app:test
- name: Rename JAR and Plugin
run: |
mv serverpackcreator-app/build/libs/serverpackcreator-app-${{ needs.preparations.outputs.version }}.jar serverpackcreator-app/build/libs/ServerPackCreator-${{ needs.preparations.outputs.version }}.jar
mv serverpackcreator-plugin-example/build/libs/serverpackcreator-plugin-example-${{ needs.preparations.outputs.version }}.jar serverpackcreator-plugin-example/build/libs/ServerPackCreator-${{ needs.preparations.outputs.version }}-Example-Plugin.jar
- name: Collect files
run: |
mkdir ${{ needs.preparations.outputs.version }}
cp serverpackcreator-api/build/libs/*.jar ${{ needs.preparations.outputs.version }}/
cp serverpackcreator-app/build/libs/*.jar ${{ needs.preparations.outputs.version }}/
cp serverpackcreator-plugin-example/build/libs/*.jar ${{ needs.preparations.outputs.version }}/
cp media/* ${{ needs.preparations.outputs.version }}/
- name: Generate checksum
uses: jmgilman/actions-generate-checksum@v1
with:
patterns: |
${{ needs.preparations.outputs.version }}/*
- name: Collect checksum
run: |
cp checksum.txt ${{ needs.preparations.outputs.version }}/
# UPLOAD ARTIFACTS
- uses: actions/upload-artifact@v4
if: ${{ always() }}
Expand All @@ -84,22 +107,13 @@ jobs:
serverpackcreator-plugin-example/build
if-no-files-found: warn # 'warn' or 'ignore' are also available, defaults to `warn`

- name: Rename JAR and Plugin
run: |
mv serverpackcreator-app/build/libs/serverpackcreator-app-${{ needs.preparations.outputs.version }}.jar serverpackcreator-app/build/libs/ServerPackCreator-${{ needs.preparations.outputs.version }}.jar
mv serverpackcreator-plugin-example/build/libs/serverpackcreator-plugin-example-${{ needs.preparations.outputs.version }}.jar serverpackcreator-plugin-example/build/libs/ServerPackCreator-${{ needs.preparations.outputs.version }}-Example-Plugin.jar
# UPLOAD ARTIFACTS
- uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: jar-media-release
path: |
media/*.dmg
media/*.sh
media/*.exe
serverpackcreator-app/build/libs/ServerPackCreator-${{ needs.preparations.outputs.version }}.jar
serverpackcreator-plugin-example/build/libs/ServerPackCreator-${{ needs.preparations.outputs.version }}-Example-Plugin.jar
${{ needs.preparations.outputs.version }}
if-no-files-found: warn # 'warn' or 'ignore' are also available, defaults to `warn`

prerelease:
Expand Down Expand Up @@ -155,18 +169,9 @@ jobs:
- uses: actions/download-artifact@v4
with:
name: jar-media-release
path: ${{ needs.preparations.outputs.version }}

- name: Generate checksum
uses: jmgilman/actions-generate-checksum@v1
with:
patterns: |
media/*.dmg
media/*.sh
media/*.exe
serverpackcreator-app/build/libs/ServerPackCreator-${{ needs.preparations.outputs.version }}.jar
serverpackcreator-plugin-example/build/libs/ServerPackCreator-${{ needs.preparations.outputs.version }}-Example-Plugin.jar
- name: Append Checksums Info
- name: Append Info
uses: DamianReeves/[email protected]
with:
path: description.txt
Expand All @@ -188,12 +193,21 @@ jobs:
prerelease: true
fail_on_unmatched_files: false
files: |
checksum.txt
media/*.dmg
media/*.sh
media/*.exe
serverpackcreator-app/build/libs/ServerPackCreator-${{ needs.preparations.outputs.version }}.jar
serverpackcreator-plugin-example/build/libs/ServerPackCreator-${{ needs.preparations.outputs.version }}-Example-Plugin.jar
${{ needs.preparations.outputs.version }}/*
- name: Get source archives
run: |
wget -O ${{ needs.preparations.outputs.version }}/source.zip https://github.com/Griefed/ServerPackCreator/archive/refs/tags/${{ needs.preparations.outputs.version }}.zip
wget -O ${{ needs.preparations.outputs.version }}/source.tar.gz https://github.com/Griefed/ServerPackCreator/archive/refs/tags/${{ needs.preparations.outputs.version }}.tar.gz
- name: Upload release to version-dir
uses: nogsantos/scp-deploy@master
with:
src: ./${{ needs.preparations.outputs.version }}
host: ${{ secrets.SPCUPLOAD_HOST }}
remote: "${{ secrets.SPCUPLOAD_TARGET }}"
user: ${{ secrets.SPCUPLOAD_USERNAME }}
key: ${{ secrets.SPCUPLOAD_KEY }}

news:
name: "News on Discord"
Expand Down
120 changes: 58 additions & 62 deletions .github/workflows/github_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,28 @@ jobs:
./gradlew -Pversion="${{ needs.preparations.outputs.version }}" build --info --full-stacktrace -x :serverpackcreator-api:test -x :serverpackcreator-app:test
./gradlew -Pversion="${{ needs.preparations.outputs.version }}" media --info --full-stacktrace -x :serverpackcreator-api:test -x :serverpackcreator-app:test
- name: Rename JAR and Plugin
run: |
mv serverpackcreator-app/build/libs/serverpackcreator-app-${{ needs.preparations.outputs.version }}.jar serverpackcreator-app/build/libs/ServerPackCreator-${{ needs.preparations.outputs.version }}.jar
mv serverpackcreator-plugin-example/build/libs/serverpackcreator-plugin-example-${{ needs.preparations.outputs.version }}.jar serverpackcreator-plugin-example/build/libs/ServerPackCreator-${{ needs.preparations.outputs.version }}-Example-Plugin.jar
- name: Collect files
run: |
mkdir ${{ needs.preparations.outputs.version }}
cp serverpackcreator-api/build/libs/*.jar ${{ needs.preparations.outputs.version }}/
cp serverpackcreator-app/build/libs/*.jar ${{ needs.preparations.outputs.version }}/
cp serverpackcreator-plugin-example/build/libs/*.jar ${{ needs.preparations.outputs.version }}/
cp media/* ${{ needs.preparations.outputs.version }}/
- name: Generate checksum
uses: jmgilman/actions-generate-checksum@v1
with:
patterns: |
${{ needs.preparations.outputs.version }}/*
- name: Collect checksum
run: |
cp checksum.txt ${{ needs.preparations.outputs.version }}/
# UPLOAD ARTIFACTS
- uses: actions/upload-artifact@v4
Expand All @@ -83,59 +105,15 @@ jobs:
serverpackcreator-plugin-example/build
if-no-files-found: warn # 'warn' or 'ignore' are also available, defaults to `warn`

- name: Rename JAR and Plugin
run: |
mv serverpackcreator-app/build/libs/serverpackcreator-app-${{ needs.preparations.outputs.version }}.jar serverpackcreator-app/build/libs/ServerPackCreator-${{ needs.preparations.outputs.version }}.jar
mv serverpackcreator-plugin-example/build/libs/serverpackcreator-plugin-example-${{ needs.preparations.outputs.version }}.jar serverpackcreator-plugin-example/build/libs/ServerPackCreator-${{ needs.preparations.outputs.version }}-Example-Plugin.jar
# UPLOAD ARTIFACTS
- uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: jar-media-release
path: |
media/*.dmg
media/*.sh
media/*.exe
serverpackcreator-app/build/libs/ServerPackCreator-${{ needs.preparations.outputs.version }}.jar
serverpackcreator-plugin-example/build/libs/ServerPackCreator-${{ needs.preparations.outputs.version }}-Example-Plugin.jar
${{ needs.preparations.outputs.version }}
if-no-files-found: warn # 'warn' or 'ignore' are also available, defaults to `warn`

- name: Collect files
run: |
mkdir ${{ needs.preparations.outputs.version }}
cp serverpackcreator-api/build/libs/*.jar ${{ needs.preparations.outputs.version }}/
cp serverpackcreator-app/build/libs/*.jar ${{ needs.preparations.outputs.version }}/
cp serverpackcreator-plugin-example/build/libs/*.jar ${{ needs.preparations.outputs.version }}/
cp media/* ${{ needs.preparations.outputs.version }}/
- name: Upload release to version-dir
uses: nogsantos/scp-deploy@master
with:
src: ./${{ needs.preparations.outputs.version }}
host: ${{ secrets.SPCUPLOAD_HOST }}
remote: "${{ secrets.SPCUPLOAD_TARGET }}"
user: ${{ secrets.SPCUPLOAD_USERNAME }}
key: ${{ secrets.SPCUPLOAD_KEY }}

- name: Cleanup latest
id: action-ssh
uses: tiyee/[email protected]
with:
host: ${{ secrets.SPCUPLOAD_HOST }}
username: ${{ secrets.SPCUPLOAD_USERNAME }}
privateKey: ${{ secrets.SPCUPLOAD_KEY }}
command: 'rm -f ${{ secrets.SPCUPLOAD_TARGET }}/latest/*'

- name: Upload release to latest-dir
uses: nogsantos/scp-deploy@master
with:
src: ./${{ needs.preparations.outputs.version }}/*
host: ${{ secrets.SPCUPLOAD_HOST }}
remote: "${{ secrets.SPCUPLOAD_TARGET }}/latest"
user: ${{ secrets.SPCUPLOAD_USERNAME }}
key: ${{ secrets.SPCUPLOAD_KEY }}

release:
name: "Release"
if: ${{ always() }}
Expand Down Expand Up @@ -183,18 +161,9 @@ jobs:
- uses: actions/download-artifact@v4
with:
name: jar-media-release
path: ${{ needs.preparations.outputs.version }}

- name: Generate checksum
uses: jmgilman/actions-generate-checksum@v1
with:
patterns: |
media/*.dmg
media/*.sh
media/*.exe
serverpackcreator-app/build/libs/ServerPackCreator-${{ needs.preparations.outputs.version }}.jar
serverpackcreator-plugin-example/build/libs/ServerPackCreator-${{ needs.preparations.outputs.version }}-Example-Plugin.jar
- name: Append Checksums Info
- name: Append Info
uses: DamianReeves/[email protected]
with:
path: description.txt
Expand All @@ -216,12 +185,39 @@ jobs:
prerelease: false
fail_on_unmatched_files: false
files: |
checksum.txt
media/*.dmg
media/*.sh
media/*.exe
serverpackcreator-app/build/libs/ServerPackCreator-${{ needs.preparations.outputs.version }}.jar
serverpackcreator-plugin-example/build/libs/ServerPackCreator-${{ needs.preparations.outputs.version }}-Example-Plugin.jar
${{ needs.preparations.outputs.version }}/*
- name: Get source archives
run: |
wget -O ${{ needs.preparations.outputs.version }}/source.zip https://github.com/Griefed/ServerPackCreator/archive/refs/tags/${{ needs.preparations.outputs.version }}.zip
wget -O ${{ needs.preparations.outputs.version }}/source.tar.gz https://github.com/Griefed/ServerPackCreator/archive/refs/tags/${{ needs.preparations.outputs.version }}.tar.gz
- name: Upload release to version-dir
uses: nogsantos/scp-deploy@master
with:
src: ./${{ needs.preparations.outputs.version }}
host: ${{ secrets.SPCUPLOAD_HOST }}
remote: "${{ secrets.SPCUPLOAD_TARGET }}"
user: ${{ secrets.SPCUPLOAD_USERNAME }}
key: ${{ secrets.SPCUPLOAD_KEY }}

- name: Cleanup latest
id: action-ssh
uses: tiyee/[email protected]
with:
host: ${{ secrets.SPCUPLOAD_HOST }}
username: ${{ secrets.SPCUPLOAD_USERNAME }}
privateKey: ${{ secrets.SPCUPLOAD_KEY }}
command: 'rm -f ${{ secrets.SPCUPLOAD_TARGET }}/latest/*'

- name: Upload release to latest-dir
uses: nogsantos/scp-deploy@master
with:
src: ./${{ needs.preparations.outputs.version }}/*
host: ${{ secrets.SPCUPLOAD_HOST }}
remote: "${{ secrets.SPCUPLOAD_TARGET }}/latest"
user: ${{ secrets.SPCUPLOAD_USERNAME }}
key: ${{ secrets.SPCUPLOAD_KEY }}

news:
name: "News on Discord"
Expand Down

0 comments on commit c97bee7

Please sign in to comment.