This repository has been archived by the owner on Oct 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (54 loc) · 2.09 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Build and release
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: jiro4989/setup-nim-action@v1
with:
nim-version: '2.0.2' # default is 'stable'
- name: Install dependencies
run: nimble install -y
- name: Build the project on Linux
run: nim c -d:release src/bdInject.nim
- name: Build the project on Windows
run: sudo apt install mingw-w64 && nim c --os:Windows -d:mingw -d:release --cpu:amd64 src/bdInject.nim
- id: vars
shell: bash
run: |
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.vars.outputs.sha_short }}
release_name: Release ${{ steps.vars.outputs.sha_short }}
draft: true
prerelease: false
body_path: ./.github/release.md
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /home/runner/work/bdInject/bdInject/src/bdInject
asset_name: bdInjectLinux
asset_content_type: application/octet-stream
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: /home/runner/work/bdInject/bdInject/src/bdInject.exe
asset_name: bdInjectWindows.exe
asset_content_type: application/octet-stream
- run: |
curl --request PATCH \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
-H "Content-Type: application/json" \
https://api.github.com/repos/${{ github.repository }}/releases/${{steps.create_release.outputs.id}} \
-d '{"draft":false}'