Skip to content

Commit

Permalink
Fix c.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
dginovker committed Jan 5, 2024
1 parent ce77508 commit ae8cfc1
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 43 deletions.
43 changes: 0 additions & 43 deletions .github/workflows/build.yml

This file was deleted.

46 changes: 46 additions & 0 deletions .github/workflows/c.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build and Release

on:
push:

jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Set up MSVC
uses: ilammy/msvc-dev-cmd@v1
- name: Compile the C code
run: cl.exe /Fe:program.exe main.c
- name: Upload the executable as an artifact
uses: actions/upload-artifact@v2
with:
name: program
path: program.exe

release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v2
with:
name: program
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.sha }}
release_name: Release ${{ github.sha }}
draft: false
prerelease: false
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./program.exe
asset_name: program.exe
asset_content_type: application/octet-stream

0 comments on commit ae8cfc1

Please sign in to comment.