GitHub Actions - Release to softprops - Enables build on tag #982
Workflow file for this run
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-macos | |
on: | |
push: | |
paths-ignore: | |
- '**/README.md' | |
pull_request: | |
paths-ignore: | |
- '**/README.md' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
ccache: ccache | |
jobs: | |
build-macos: | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
cfg: | |
- { target: osx } | |
env: | |
TARGET: ${{ matrix.cfg.target }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: ccache | |
uses: hendrikmuhs/ccache-action@v1.2.14 | |
with: | |
# key: ${{ matrix.os }}-${{ matrix.type }} | |
key: ${{ matrix.os }}-${{ matrix.cfg.target }} | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 16 | |
- name: Setup | |
run: ./scripts/osx/setup_environment.sh | |
- name: Determine Release | |
id: vars | |
shell: bash | |
run: | | |
if [[ "${{ github.ref }}" == refs/tags/* ]]; then | |
echo "RELEASE=${{ github.ref_name }}" >> $GITHUB_ENV | |
echo "PRERELEASE=false" >> $GITHUB_ENV | |
elif [[ "${{ github.ref }}" == "refs/heads/master" ]]; then | |
echo "RELEASE=nightly" >> $GITHUB_ENV | |
echo "PRERELEASE=false" >> $GITHUB_ENV | |
elif [[ "${{ github.ref }}" == "refs/heads/bleeding" ]]; then | |
echo "RELEASE=bleeding" >> $GITHUB_ENV | |
echo "PRERELEASE=true" >> $GITHUB_ENV | |
else | |
echo "RELEASE=bleeding" >> $GITHUB_ENV | |
echo "PRERELEASE=true" >> $GITHUB_ENV | |
fi | |
- name: PWD and LS | |
run: | | |
echo "Current directory: (should be projectGenerator)" | |
pwd | |
echo "Directory contents:" | |
ls | |
- name: Setup CI setup environment / checkout oF | |
run: | | |
./scripts/osx/ci_install_core.sh | |
- name: Build PG macOS GUI and command line | |
run: | | |
# echo "Current directory after moving up: (should be projectGenerator/projectGenerator)" | |
# pwd | |
cd ../ | |
# echo "Current directory after moving up: (should be projectGenerator/)" | |
# echo "------------------" | |
# pwd | |
# ls | |
# echo "------------------" | |
if [ -f "openFrameworks/apps/projectGenerator/scripts/osx/ci_build_pg.sh" ]; then | |
echo "ci_build_pg.sh exists, running script..." | |
openFrameworks/apps/projectGenerator/scripts/osx/ci_build_pg.sh | |
else | |
echo "ci_build_pg.sh does not exist, checking Git status..." | |
if cd openFrameworks/apps/projectGenerator; then | |
echo "Current Git branch in projectGenerator:" | |
git rev-parse --abbrev-ref HEAD | |
echo "Latest commit hash in projectGenerator:" | |
git rev-parse HEAD | |
else | |
echo "Failed to change directory to openFrameworks/apps/projectGenerator" | |
fi | |
echo "Current directory: (should be openFrameworks/apps/projectGenerator)" | |
pwd | |
echo "Directory contents:" | |
ls | |
echo "------------------" | |
echo "Failure exit1" | |
exit 1 | |
fi | |
env: | |
GA_CI_SECRET: ${{ secrets.CI_SECRET }} | |
CERTIFICATE_OSX_APPLICATION: ${{ secrets.CERTIFICATE_OSX_APPLICATION }} | |
CERTIFICATE_PASSWORD: ${{ secrets.CERTIFICATE_PASSWORD }} | |
GA_APPLE_USERNAME: ${{ secrets.GA_APPLE_USERNAME }} | |
GA_APPLE_PASS: ${{ secrets.GA_APPLE_PASS }} | |
GA_NOTARIZE_PROVIDER: ${{ secrets.GA_NOTARIZE_PROVIDER }} | |
- name: Check output | |
run: | | |
echo "Current directory: (should be projectGenerator)" | |
pwd | |
echo "Directory contents:" | |
ls | |
if [ -f "projectGenerator/projectGenerator-osx.zip" ]; then | |
echo "projectGenerator/projectGenerator-osx.zip found at level 1" | |
else | |
echo "projectGenerator/projectGenerator-osx.zip NOT found at level 1" | |
fi | |
if [ -f "projectGenerator/projectGenerator/projectGenerator-osx.zip" ]; then | |
echo "projectGenerator/projectGenerator/projectGenerator-osx.zip found at level 2" | |
else | |
echo "projectGenerator/projectGenerator/projectGenerator-osx.zip NOT found at level 2" | |
fi | |
if [ -f "projectGenerator-osx.zip" ]; then | |
echo "projectGenerator-osx.zip found at level 0" | |
else | |
echo "projectGenerator-osx.zip NOT found at level 0" | |
fi | |
- name: Test cmdline | |
run: ../openFrameworks/apps/projectGenerator/scripts/osx/test_cmdline.sh | |
- name: Update Release macOS | |
if: github.repository == 'openframeworks/apothecary' && github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/bleeding') | |
uses: softprops/action-gh-release@v2.0.8 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
tag_name: ${{ env.RELEASE }} | |
release: ${{ env.RELEASE }} | |
files: projectGenerator-osx.zip |