Skip to content

Commit

Permalink
Add github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
zw963 committed May 22, 2022
1 parent d73ddec commit b462ee0
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
on:
release:
types:
- created

jobs:
build:
runs-on: ubuntu-latest
container:
image: crystallang/crystal:1.4-alpine
steps:
# - name: Install Crystal
# uses: crystal-lang/install-crystal@v1
- name: Cache shards
uses: actions/cache@v2
with:
path: ~/.cache/shards
key: ${{ runner.os }}-shards-${{ hashFiles('shard.yml') }}
restore-keys: ${{ runner.os }}-shards-
- name: Download source
uses: actions/checkout@v2
- name: Install shards
run: shards check || shards install
- name: Check formatting
run: crystal tool format --check
- name: Run tests
run: crystal spec
- name: release binary
run: |
shards build --production --release --static --no-debug
strip ./bin/crystal_hello_world
- name: Upload
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./bin/crystal_hello_world
asset_name: crystael_hello_world-${{ github.event.release.tag_name }}-linux-x86_64
asset_content_type: binary/octet-stream

0 comments on commit b462ee0

Please sign in to comment.