ci: add workflows, add Rakefile #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # This CI job installs Crystal and shard dependencies, then executes `crystal spec` to run the test suite | |
| # More configuration options are available at https://crystal-lang.github.io/install-crystal/configurator.html | |
| name: Matrix Build | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| push: | |
| branches: | |
| - master | |
| - dev | |
| concurrency: | |
| group: ${{ github.sha }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| - os: macos-latest | |
| - os: windows-latest | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Download source | |
| uses: actions/checkout@v4 | |
| - name: Install Crystal | |
| uses: crystal-lang/install-crystal@v1 | |
| - name: Install shards | |
| run: shards install | |
| - name: Build | |
| run: rake upload | |
| - name: Create release | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: ${{ github.ref }} | |
| release_name: Release ${{ github.ref }} | |
| draft: false | |
| prerelease: false | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v3 | |
| with: | |
| name: choose-${{ github.ref }}-${{ matrix.os }} | |
| path: "upload/*" | |
| - name: Upload to Release | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| files: "upload/*" |