Skip to content

Commit

Permalink
Update github-actions-youtd.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Praytic authored Apr 4, 2023
1 parent 1cefa28 commit 45f56eb
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/github-actions-youtd.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: YouTD
name: YouTD2

on:
push:
Expand All @@ -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)
Expand All @@ -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 }}
Expand All @@ -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: .

0 comments on commit 45f56eb

Please sign in to comment.