From 4ca3f48acc0742a1f92ff09dfe605ecf4dba4170 Mon Sep 17 00:00:00 2001 From: "Mr. Pennyworth" Date: Mon, 14 Jun 2021 11:49:13 +0530 Subject: [PATCH] Add github release script --- .github/workflows/build.yml | 43 +++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..13e277b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,43 @@ +name: Build and Release + +on: [push, workflow_dispatch] + +jobs: + build-and-release: + name: Build and Release the Workflow + runs-on: macos-10.15 + steps: + + - name: Checkout code + uses: actions/checkout@v2 + + - name: Build the Workflow + run: python3 build-scripts/mkworkflow.py + + - name: Get Workflow Version + run: echo "WF_VERSION=$(plutil -extract version xml1 -o - info.plist | sed -n 's/.*\(.*\)<\/string>.*/\1/p')" >> $GITHUB_ENV + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ env.WF_VERSION }} + release_name: ${{ env.WF_VERSION }} + draft: false + prerelease: false + + - name: Get Workflow Filename + run: echo "WF_FILENAME=$(ls *.alfredworkflow)" >> $GITHUB_ENV + + - 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: ./${{ env.WF_FILENAME }} + asset_name: ${{ env.WF_FILENAME }} + asset_content_type: application/zip