Add Transport: Play and Transport: Stop actions to what we report #130
Workflow file for this run
This file contains hidden or 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
# Build and upload OSARA for pushes or pull requests. | |
name: build | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
types: [opened, synchronize] | |
defaults: | |
run: | |
shell: bash | |
env: | |
publisher: James Teh | |
VSCMD_SKIP_SENDTELEMETRY: 1 | |
SCONS_CACHE_MSVC_CONFIG: 1 | |
concurrency: | |
# There's no point continuing to run a build if it's already outdated by | |
# another commit. | |
group: build-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [windows-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: set env | |
run: | | |
echo "CACHE_KEY=${RUNNER_OS}-${ImageVersion}" >> $GITHUB_ENV | |
if [ $GITHUB_EVENT_NAME == push ]; then | |
# For example: 2025.3.7.2011,23631c6e | |
# We add 1800 to GITHUB_RUN_NUMBER because we can't set the | |
# starting number and we were already past 1700 on AppVeyor. | |
echo version=`date +%Y.%-m.%-d`.$((GITHUB_RUN_NUMBER + 1800)),${GITHUB_SHA:0:8} >> "$GITHUB_ENV" | |
else | |
# For example: pr1234-101,23631c6e | |
echo version=pr${{ github.event.number }}-$GITHUB_RUN_NUMBER,${GITHUB_SHA:0:8} >> "$GITHUB_ENV" | |
fi | |
if [ ${{ matrix.os }} == windows-latest ]; then | |
echo os=windows >> "$GITHUB_ENV" | |
else | |
echo os=mac >> "$GITHUB_ENV" | |
fi | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
# There's no point in building if we're going to fail the build because of | |
# an unsorted key map, so we do this as early as we can. | |
- name: check key map | |
run: python tools/sortKeymap.py -t config/${{ env.os }}/reaper-kb.ini | |
- name: setup | |
run: pip install scons | |
- name: SCons MSVC Cache | |
if: ${{ matrix.os == 'windows-latest' }} | |
uses: actions/cache@v4 | |
with: | |
path: ~\scons_msvc_cache.json | |
key: ${{ env.CACHE_KEY }} | |
- name: Windows setup | |
if: ${{ matrix.os == 'windows-latest' }} | |
# Use NSIS 2.46 to reduce AV false positives. | |
run: | | |
choco uninstall nsis nsis.install -y | |
choco install nsis-unicode -y | |
- name: Mac setup | |
if: ${{ matrix.os == 'macos-latest' }} | |
# We need php for swell_resgen. | |
run: brew install php | |
- name: build | |
run: scons "publisher=${{ env.publisher }}" version=${{ env.version }} | |
- name: sign | |
if: ${{ github.event_name == 'push' && matrix.os == 'windows-latest' }} | |
uses: azure/trusted-signing-action@v0 | |
with: | |
azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
azure-client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }} | |
endpoint: ${{ vars.AZURE_SIGNING_ENDPOINT }} | |
trusted-signing-account-name: ${{ vars.AZURE_SIGNING_NAME }} | |
certificate-profile-name: ${{ vars.AZURE_SIGNING_CERT_NAME }} | |
files-folder: ${{ github.workspace }}\installer | |
files-folder-filter: exe | |
# We only need to upload the pot on one OS. We arbitrarily pick Windows. | |
- name: pot | |
if: ${{ github.event_name == 'push' && matrix.os == 'windows-latest' }} | |
env: | |
crowdinAuthToken: ${{ secrets.CROWDIN_AUTH_TOKEN }} | |
run: | | |
scons version=${{ env.version }} pot | |
pip install requests | |
python ci/crowdinSync uploadPot | |
# Normal artifacts are always zipped. We upload snapshot builds to GitHub | |
# Releases so they can be downloaded directly. | |
- id: uploadBuild | |
name: upload build | |
if: ${{ github.event_name == 'push' }} | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: installer/osara_* | |
# We have a hacky release we reuse for snapshots, rather than | |
# creating a tag and a release for every snapshot. | |
tag_name: snapshots | |
- id: getBuildUrl | |
name: get build URL | |
if: ${{ github.event_name == 'push' }} | |
run: | | |
echo ${{ env.os }}Url=${{ fromJSON(steps.uploadBuild.outputs.assets)[0].browser_download_url }} >> "$GITHUB_OUTPUT" | |
# We upload pull request builds as normal artifacts. | |
- name: upload PR build | |
if: ${{ github.event_name == 'pull_request' }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: osara_${{ env.os }}_${{ env.version }} | |
path: installer/osara_* | |
# The installer is already compressed. Don't try to compress it again. | |
compression-level: 0 | |
outputs: | |
version: ${{ env.version }} | |
# These will only be set for snapshot builds. Furthermore, each OS job | |
# will only set the output relevant to that OS. This is possible because | |
# outputs won't be set if the value is empty. | |
winInstallerUrl: ${{ steps.getBuildUrl.outputs.windowsUrl }} | |
macInstallerUrl: ${{ steps.getBuildUrl.outputs.macUrl }} | |
publish: | |
# This job updates the website with the new readme and snapshots. | |
if: ${{ github.event_name == 'push' }} | |
needs: build | |
runs-on: ubuntu-latest | |
permissions: | |
pages: write | |
id-token: write | |
steps: | |
- name: setup | |
run: pip install markdown | |
- uses: actions/checkout@v4 | |
- name: build | |
env: | |
version: ${{ needs.build.outputs.version }} | |
winUrl: ${{ needs.build.outputs.winInstallerUrl }} | |
macUrl: ${{ needs.build.outputs.macInstallerUrl }} | |
run: python ci/buildSite | |
- name: upload | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
# ci/buildSite built the site in _site/. | |
path: _site/ | |
- name: deploy | |
uses: actions/deploy-pages@v4 |