From f621a91335ce23336b2d567fab3b4656395df62e Mon Sep 17 00:00:00 2001 From: brandonsturgeon Date: Thu, 27 Jan 2022 08:42:11 +0000 Subject: [PATCH] Update moonscript_release workflow to 0.33 --- .github/workflows/moonscript_release.yml | 84 ++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 .github/workflows/moonscript_release.yml diff --git a/.github/workflows/moonscript_release.yml b/.github/workflows/moonscript_release.yml new file mode 100644 index 0000000..b03a34e --- /dev/null +++ b/.github/workflows/moonscript_release.yml @@ -0,0 +1,84 @@ +name: Create Moonscript Release + +on: + push: + tags: + - '*' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: CD + run: cd $GITHUB_WORKSPACE + + - name: Update apt + run: sudo apt-get update -y + + - name: Install LuaRocks + run: sudo apt-get install -y luarocks + + - name: Install Moonscript + run: sudo luarocks install moonscript + + - name: Build Lua + run: moonc -t lua moon/* + + - name: Remove moon + run: rm -rf moon + + - name: Remove github dir + run: rm -rf .github + + - name: Remove .gitignore + run: rm -rf .gitignore + + - name: Create VERSION file + run: versionStr=${{ github.ref }};echo -e v${versionStr#*v} > VERSION + + - name: Push to lua branch + run: | + git config user.name github-actions + git config user.email github-actions@github.com + git add . + git commit -m "Release build: $(cat VERSION)" + git push -f origin HEAD:lua + + - name: Remove .git dir + run: rm -rf .git + + - name: Create subdirectory + run: mkdir ${{ github.event.repository.name }} + + - name: Move files into sub directory + run: ls | grep -v ${{ github.event.repository.name }} | xargs mv -t ${{ github.event.repository.name }} + + - name: Create Release Asset + run: zip -r9 ${{ github.event.repository.name }}.zip . + + - name: Publish Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + body: Latest Release with pre-compiled Lua (Ready to put in your addons directory) + draft: false + prerelease: false + + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./${{ github.event.repository.name }}.zip + asset_name: ${{ github.event.repository.name }}.zip + asset_content_type: application/zip +