mirror of
https://github.com/ronitsinha/almia-randomizer.git
synced 2026-09-06 17:54:36 -05:00
Create c-cpp.yml
This commit is contained in:
61
.github/workflows/c-cpp.yml
vendored
Normal file
61
.github/workflows/c-cpp.yml
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
name: Build and Release
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
tags:
|
||||
- 'v*'
|
||||
pull_request:
|
||||
branches: [ "main" ]
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
tag: ${{ steps.tag.outputs.tag }}
|
||||
steps:
|
||||
- name: 'Generate Tag'
|
||||
run: echo ::set-output name=tag::${GITHUB_REF#refs/tags/}
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
id: tag
|
||||
- name: 'Create Release'
|
||||
id: create_release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: ${{ steps.tag.outputs.tag }}
|
||||
release_name: Release ${{ steps.tag.outputs.tag }}
|
||||
build-linux:
|
||||
runs-on: ubuntu-latest
|
||||
needs: release
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: make
|
||||
run: make
|
||||
- name: 'Upload Linux Binary'
|
||||
id: upload-release-asset-linux
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ needs.release.outputs.upload_url }}
|
||||
asset_path: range_randomizer
|
||||
asset_name: range_randomizer
|
||||
build-windows:
|
||||
runs-on: windows-latest
|
||||
needs: release
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: make
|
||||
run: make OUTPUT=range_randomizer.exe
|
||||
- name: 'Upload Windows Binary'
|
||||
id: upload-release-asset-windows
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ needs.release.outputs.upload_url }}
|
||||
asset_path: range_randomizer.exe
|
||||
asset_name: range_randomizer.exe
|
||||
Reference in New Issue
Block a user