Skip to content

Commit

Permalink
Use GitHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
cprecioso committed Oct 21, 2020
1 parent cee7f5e commit a360e81
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
with:
# Artifact name
name: "SoulverCore-${{ github.sha }}.alfredworkflow"
# A file, directory or wildcard pattern that describes what to upload
path: .build/SoulverCore.alfredworkflow
47 changes: 47 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit a360e81

Please sign in to comment.