Skip to content

Commit

Permalink
Add github release script
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-pennyworth committed Jun 14, 2021
1 parent c1d60ba commit 4ca3f48
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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>\(.*\)<\/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

0 comments on commit 4ca3f48

Please sign in to comment.