Include src.zip files (#338) #676
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: CI | |
on: [ push, pull_request, workflow_dispatch ] | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: ubuntu-22.04 | |
artifact-name: Linux | |
build-options: "-PlinuxBuild" | |
- os: macos-latest | |
artifact-name: macOS | |
build-options: "-PmacBuild" | |
- os: macos-latest | |
artifact-name: macOSArm | |
build-options: "-PmacBuildArm" | |
- os: windows-latest | |
artifact-name: Win64 | |
build-options: "" | |
name: "Build - ${{ matrix.artifact-name }}" | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 7.0.100 | |
- uses: actions/setup-java@v3 | |
with: | |
java-version: 11 | |
distribution: temurin | |
- name: Import Developer ID Certificate | |
uses: wpilibsuite/import-signing-certificate@v1 | |
with: | |
certificate-data: ${{ secrets.APPLE_CERTIFICATE_DATA }} | |
certificate-passphrase: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }} | |
keychain-password: ${{ secrets.APPLE_KEYCHAIN_PASSWORD }} | |
if: | | |
(matrix.artifact-name == 'macOS' || matrix.artifact-name == 'macOSArm') && | |
github.repository_owner == 'wpilibsuite' && | |
(github.event_name == 'push' || github.event_name == 'workflow_dispatch') | |
- name: Set Keychain Lock Timeout | |
run: security set-keychain-settings -lut 2700 | |
if: | | |
(matrix.artifact-name == 'macOS' || matrix.artifact-name == 'macOSArm') && | |
github.repository_owner == 'wpilibsuite' && | |
(github.event_name == 'push' || github.event_name == 'workflow_dispatch') | |
- name: Install roboRIO Toolchain | |
shell: bash | |
run: ./gradlew installRoboRioToolchain | |
- name: Build Installer (PR) | |
shell: bash | |
run: ./gradlew generateInstallers -PjenkinsBuild ${{ matrix.build-options }} | |
if: | | |
github.repository_owner != 'wpilibsuite' || | |
(github.event_name != 'push' && github.event_name != 'workflow_dispatch') | |
- name: Build Installer (Main) | |
shell: bash | |
run: | | |
./gradlew generateInstallers -PjenkinsBuild ${{ matrix.build-options }} \ | |
-PdeveloperID=${{ secrets.APPLE_DEVELOPER_ID }} \ | |
-Pnotarization-username=${{ secrets.APPLE_NOTARIZATION_USERNAME }} \ | |
-Pnotarization-password=${{ secrets.APPLE_NOTARIZATION_PASSWORD }} | |
if: | | |
github.repository_owner == 'wpilibsuite' && | |
(github.event_name == 'push' || github.event_name == 'workflow_dispatch') | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.artifact-name }} | |
path: build/pubOutputs/ | |
release: | |
name: "Release" | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@v3 | |
- name: Print Checksums | |
run: | | |
md5sum **/* | |
sha256sum **/* | |
- name: Upload to GitHub wpilibsuite/allwpilib | |
if: | | |
github.repository_owner == 'wpilibsuite' && | |
startsWith(github.ref, 'refs/tags/v') | |
run: | | |
if ( gh -R wpilibsuite/allwpilib release view "${GITHUB_REF#refs/tags/}" 1> /dev/null ) ; then | |
gh -R wpilibsuite/allwpilib release upload --clobber "${GITHUB_REF#refs/tags/}" **/* | |
else | |
gh -R wpilibsuite/allwpilib release create -d "${GITHUB_REF#refs/tags/}" **/* | |
fi | |
env: | |
GITHUB_TOKEN: ${{secrets.GH_ADMIN_TOKEN}} | |
format: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 7.0.100 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.8 | |
- name: Install black | |
run: pip3 install black | |
- name: Run dotnet format | |
run: dotnet format | |
- name: Run black | |
run: black . | |
- name: Verify formatters made no changes | |
run: git --no-pager diff --exit-code HEAD |