diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..7e71a5f --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,28 @@ +name: Build commit + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + build: + runs-on: macos-latest + + steps: + - uses: actions/checkout@v2 + + - name: Select Xcode 12 + run: sudo xcode-select -s /Applications/Xcode_12.app + + - name: Build + run: make + + - name: Upload a Build Artifact + uses: actions/upload-artifact@v2.2.0 + with: + # Artifact name + name: "SoulverCore-${{ github.sha }}.alfredworkflow" + # A file, directory or wildcard pattern that describes what to upload + path: .build/SoulverCore.alfredworkflow diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..3fd8579 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,47 @@ +name: Release version + +on: + push: + tags: + - "v*" # Push events to matching v*, i.e. v1.0, v20.15.10 + +jobs: + build_and_upload: + runs-on: macos-latest + + steps: + - uses: actions/checkout@v2 + + - name: Get the version + id: get_version + run: echo ::set-output name=version::${GITHUB_REF/refs\/tags\//} + + - name: Select Xcode 12 + run: sudo xcode-select -s /Applications/Xcode_12.app + + - name: Build + run: make + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token + with: + tag_name: ${{ github.ref }} + release_name: ${{ github.ref }} + draft: false + prerelease: false + commitish: ${{ github.sha }} + + - 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 }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps + asset_path: .build/SoulverCore.alfredworkflow + asset_name: + "SoulverCore-${{ steps.get_version.outputs.version }}.alfredworkflow" + asset_content_type: application/zip