Files
picard/.github/workflows/package-macos.yml
Philipp Wolfer 1fd305c9fe Github Actions: Do not trigger builds on tag / branch create
Limiting this to specific tags / branches seems unsupported, also it seems that tag pushes still trigger the build.
2019-11-29 07:43:47 +01:00

70 lines
2.0 KiB
YAML

name: Package for macOS
on:
push:
paths:
- '.github/workflows/package-macos.yml'
- 'picard/**'
- 'po/**.po'
- 'resources/win10/**'
- 'scripts/package/*'
- '!scripts/package/*.ps1'
- 'scripts/pyinstaller/*'
- 'picard.icns'
- 'picard.spec'
- 'requirements*.txt'
- 'setup.py'
- 'tagger.py.in'
jobs:
package:
runs-on: macos-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Patch build version
if: startsWith(github.ref, 'refs/tags/') != true
run: |
python setup.py patch_version --platform=$(git rev-list --count HEAD).$(git rev-parse --short HEAD)
- name: Setup macOS build environment
run: |
./scripts/package/macos-setup.sh
mkdir artifacts
env:
DISCID_VERSION: 0.6.2
FPCALC_VERSION: 1.4.3
- name: Install dependencies
run: |
python -m pip install --upgrade pip
source bin/activate
pip install -r requirements-macos.txt
- name: Build macOS app
run: |
source bin/activate
./scripts/package/macos-package-app.sh
mv dist/*.dmg artifacts/
env:
APPLE_ID_USER: ${{ secrets. APPLE_ID_USER }}
APPLE_ID_PASSWORD: ${{ secrets. APPLE_ID_PASSWORD }}
encrypted_be5fb2212036_key: ${{ secrets.CODESIGN_MACOS_ENCRYPTED_KEY }}
encrypted_be5fb2212036_iv: ${{ secrets.CODESIGN_MACOS_ENCRYPTED_IV }}
appledev_p12_password: ${{ secrets.CODESIGN_MACOS_P12_PASSWORD }}
- name: Archive production artifacts
uses: actions/upload-artifact@v1
if: always()
with:
name: macos-builds
path: artifacts/
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/') && github.event_name == 'create'
with:
files: artifacts/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}