Fix second typo #47
This file contains 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
name: Build C++ utility | |
on: [push] | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Restore MSYS2 package cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
C:\msys64\var\cache\pacman\pkg | |
C:\msys64\var\lib\pacman\sync | |
key: msys2-pkgs-${{ runner.os }}-${{ hashFiles('api.dll') }} | |
- name: Set up MSYS2 | |
uses: msys2/setup-msys2@v2 | |
with: | |
update: true | |
install: mingw-w64-x86_64-gcc | |
- name: Compile to .dll | |
shell: msys2 {0} | |
run: | | |
g++ -Ofast -Wall -shared -std=c++20 -static -o api.dll api.cpp -lgdi32 | |
ls -l api.dll | |
- name: Commit and push .dll file | |
run: | | |
git config --global user.name "Ethan Chan" | |
git config --global user.email "[email protected]" | |
git add . -f | |
git commit -m "Auto-build api.dll using g++" || echo "No changes to commit" | |
git push https://[email protected]/eschan145/DieKnow.git | |
env: | |
# A GitHub PAT must be set up as an Actions secret in the repository | |
GH_PAT: ${{ secrets.GH_PAT }} | |
- name: Save MSYS2 package cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
C:\msys64\var\cache\pacman\pkg | |
C:\msys64\var\lib\pacman\sync | |
key: msys2-pkgs-${{ runner.os }}-${{ hashFiles('api.cpp') }} | |
restore-keys: | | |
msys2-pkgs-${{ runner.os }}- |