-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
20 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: YouTD | ||
name: YouTD2 | ||
|
||
on: | ||
push: | ||
|
@@ -19,11 +19,13 @@ jobs: | |
# Ensure that you get the entire project history | ||
with: | ||
fetch-depth: 0 | ||
|
||
# Automatically stores the tag name for later use | ||
- name: Get tag from version | ||
id: tag_version | ||
run: | | ||
echo "TAG_VERSION=$GITHUB_REF_NAME" >> $GITHUB_OUTPUT | ||
- name: Export game | ||
id: export | ||
# Use latest version (see releases for all versions) | ||
|
@@ -36,21 +38,35 @@ jobs: | |
verbose: true | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Set env NEED | ||
run: | | ||
if [[ ${{ steps.tag_version.outputs.TAG_VERSION }} =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]] ; then | ||
echo "NEED=true" >> "$GITHUB_ENV" | ||
else | ||
echo "NEED=false" >> "$GITHUB_ENV" | ||
fi | ||
- name: Enable threads for Chrome | ||
run: | | ||
curl https://raw.githubusercontent.com/josephrocca/clip-image-sorter/main/enable-threads.js > ${{ steps.export.outputs.build_directory }}/Web/enable-threads.js | ||
- name: Create compressed zip | ||
run: | | ||
zip -r youtd-${{ steps.tag_version.outputs.TAG_VERSION }}.zip ${{ steps.export.outputs.build_directory }}/Web/* | ||
- uses: actions/upload-artifact@v3 | ||
if: env.NEED == 'true' | ||
with: | ||
name: youtd-${{ steps.tag_version.outputs.TAG_VERSION }} | ||
path: ${{ steps.export.outputs.build_directory }}/Web/* | ||
|
||
- uses: actions/upload-artifact@v3 | ||
if: env.NEED == 'true' | ||
with: | ||
name: youtd-${{ steps.tag_version.outputs.TAG_VERSION }}-zip | ||
path: youtd-${{ steps.tag_version.outputs.TAG_VERSION }}.zip | ||
|
||
outputs: | ||
tag_version: ${{ steps.tag_version.outputs.TAG_VERSION }} | ||
need_release: ${{ env.NEED }} | ||
|
@@ -65,15 +81,17 @@ jobs: | |
uses: actions/download-artifact@v3 | ||
with: | ||
name: youtd-${{ needs.build_client.outputs.tag_version }} | ||
|
||
- name: Release client | ||
uses: ncipollo/[email protected] | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
generateReleaseNotes: true | ||
tag: ${{ needs.build_client.outputs.tag_version }} # Note that the 'v' in front was necessary to get this action attach artifacts to the tag | ||
artifacts: ./* | ||
|
||
- name: Deploy to github pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: . | ||
publish_dir: . |