From dc31c7fdadca033507c6178f3cb6e977f1c1aa99 Mon Sep 17 00:00:00 2001 From: sophia Date: Sat, 10 Oct 2020 17:09:06 -0700 Subject: [PATCH] Add GitHub Actions (#3) --- .github/workflows/build_and_release.yml | 54 +++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/build_and_release.yml diff --git a/.github/workflows/build_and_release.yml b/.github/workflows/build_and_release.yml new file mode 100644 index 0000000..e2de4ef --- /dev/null +++ b/.github/workflows/build_and_release.yml @@ -0,0 +1,54 @@ +name: CI + +on: + push: + tags: + - 'v*' + +jobs: + build_and_release: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Fetch lovr exe + run: | + curl https://lovr.org/download -L -o lovr.zip + unzip lovr.zip -d layout + + - name: Package Layout + run: | + cd src + zip -0qr layout.lovr . + cat ../layout/lovr.exe layout.lovr > ../layout/layout.exe + cd ../layout + rm lovr.exe + zip -9qr layout.zip . + + - name: Set version number + id: set_version + run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/} + + - name: Create release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ steps.set_version.outputs.VERSION }} + release_name: Layout ${{ steps.set_version.outputs.VERSION }} + body: Layout ${{ steps.set_version.outputs.VERSION }} + draft: false + prerelease: false + + - name: Upload Layout artifact + 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: ./layout/layout.zip + asset_name: layout.zip + asset_content_type: application/zip