-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: add action to upload built patch files #325
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,50 +6,80 @@ on: | |
|
||
env: | ||
BUILD_TYPE: Release | ||
WORKING_DIRECTORY: ${{ github.workspace }}/build | ||
|
||
jobs: | ||
build-mingw: | ||
runs-on: ubuntu-24.04 | ||
|
||
steps: | ||
|
||
- name: Install packages | ||
run: | | ||
sudo dpkg --add-architecture i386 | ||
sudo apt-get update | ||
sudo apt-get install --no-install-recommends g++-mingw-w64-i686-posix ninja-build wine32 wine | ||
shell: bash | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why set There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed, I'll remove it from What about Windows? Do I keep it as an explicit value, as |
||
|
||
- uses: actions/checkout@v4 | ||
|
||
- name: Set Current Git Commit Head SHA | ||
run: echo "GIT_CURRENT_COMMIT_HEAD_SHA=$(git rev-parse --short=10 HEAD)" >> $GITHUB_ENV | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed. In fact, I will remove this flag as it is optional. |
||
shell: bash | ||
|
||
- name: Create Build Environment | ||
run: cmake -E make_directory ${{github.workspace}}/build | ||
run: cmake -E make_directory ${{ env.WORKING_DIRECTORY }} | ||
shell: bash | ||
|
||
- name: Configure CMake | ||
working-directory: ${{github.workspace}}/build | ||
working-directory: ${{ env.WORKING_DIRECTORY }} | ||
run: cmake .. -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_TOOLCHAIN_FILE=../cmake/mingw-ubuntu.cmake | ||
shell: bash | ||
|
||
- name: Print nproc | ||
run: nproc | ||
shell: bash | ||
|
||
- name: Build | ||
working-directory: ${{github.workspace}}/build | ||
working-directory: ${{ env.WORKING_DIRECTORY }} | ||
run: cmake --build . -j $(nproc) | ||
shell: bash | ||
|
||
- name: Upload Patch Files | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
compression-level: 9 | ||
if-no-files-found: error | ||
name: dashfaction-${{ env.GIT_CURRENT_COMMIT_HEAD_SHA }}-mingw | ||
path: ${{ env.WORKING_DIRECTORY }}/bin | ||
|
||
build-msvc: | ||
runs-on: windows-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set Current Git Commit Head SHA | ||
run: echo "GIT_CURRENT_COMMIT_HEAD_SHA=$(git rev-parse --short=10 HEAD)" >> $GITHUB_ENV | ||
shell: bash | ||
|
||
- name: Create Build Environment | ||
run: cmake -E make_directory ${{github.workspace}}/build | ||
run: cmake -E make_directory ${{ env.WORKING_DIRECTORY }} | ||
shell: bash | ||
|
||
- name: Configure CMake | ||
shell: cmd | ||
working-directory: ${{github.workspace}}/build | ||
working-directory: ${{ env.WORKING_DIRECTORY }} | ||
run: cmake .. -A Win32 | ||
shell: bash | ||
|
||
- name: Build | ||
shell: cmd | ||
working-directory: ${{github.workspace}}/build | ||
working-directory: ${{ env.WORKING_DIRECTORY }} | ||
run: cmake --build . --config %BUILD_TYPE% -j 4 | ||
shell: bash | ||
|
||
- name: Upload Patch Files | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
compression-level: 9 | ||
if-no-files-found: error | ||
name: dashfaction-${{ env.GIT_CURRENT_COMMIT_HEAD_SHA }}-msvc | ||
path: ${{ env.WORKING_DIRECTORY }}/bin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure we need that var. It is not a working dir in every step so its name may be confusing. Maybe it should be
BUILD_DIR
?But from docs I also see that they don't prefix it with
${{github.workspace}}
so it is pretty muchBUILD_DIR: ./build
. With such a simple value I'm not convinced it actually brings much value.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I introduced this global variable as this path is used in multiple places. This is only for consistency and to not repeat.
I agree that the name is not the best. Do you want me to revert this change or only change the variable's name?