Skip to content

Commit

Permalink
Merge pull request #64 from hwangswan/master
Browse files Browse the repository at this point in the history
Added release workflow
  • Loading branch information
trhgquan authored Jan 28, 2022
2 parents 6d69780 + f0aebaf commit 8e1ccd6
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 5 deletions.
8 changes: 8 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escaptes: '\<*_&'
template: |
## What's changed
$CHANGES
60 changes: 56 additions & 4 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,68 @@ on:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest
build-and-test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ['windows-latest', 'ubuntu-latest']

steps:
- uses: actions/checkout@v2
name: Checkout repository

- name: make
run: make
- name: make copy test into testing folder

- name: make - copy test into testing folder
run: make init_test
- name: make test

- name: make - test
run: make test

- name: Upload artifacts (pushes only)
uses: actions/upload-artifact@v2
with:
name: build-executable
path: |
data/
main
main.exe
if-no-files-found: error
if: ${{ github.event_name == 'push' }}

- name: cleaning afterworks
run: make clean

create-release:
if: ${{ github.event_name == 'push' }}
runs-on: ubuntu-latest
needs: build-and-test
steps:
- name: Download artifacts from previous build
uses: actions/download-artifact@v2
with:
name: build-executable

- name: Zipping release artifact
uses: vimtor/action-zip@v1
with:
files: data/ main main.exe
recursive: false
dest: release.zip

- name: Drafting a new release.
uses: release-drafter/release-drafter@v5
id: draft-new-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.draft-new-release.outputs.upload_url }}
asset_path: release.zip
asset_name: release.zip
asset_content_type: application/zip
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Calculating my GPA, in an OOP way.

- On Windows:
```
g++ src/main.cpp main -std=c++17
g++ src/*.cpp main -std=c++17
```

So simple, right?
Expand Down

0 comments on commit 8e1ccd6

Please sign in to comment.