-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update moonscript_release workflow to 0.33
- Loading branch information
1 parent
5d0ef05
commit f621a91
Showing
1 changed file
with
84 additions
and
0 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 |
---|---|---|
@@ -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 | ||
|