-
-
Notifications
You must be signed in to change notification settings - Fork 1
Fix workflows #26
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
name: Build Trovatore (macOS) | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
permissions: | |
contents: read | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-13, macos-14] | |
dc: [ldc-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dlang-community/setup-dlang@v1 | |
with: | |
compiler: ${{ matrix.dc }} | |
- name: 'Set Version' | |
run: | | |
echo "commit: ${GITHUB_SHA::7}" > version | |
- name: Set version info for release | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
VERSION=$(echo ${{ github.ref }} | sed 's/refs\/tags\///') | |
echo "$VERSION" >> version | |
- name: 'Build & Test' | |
run: | | |
dub build --compiler=$DC --build=release --config=trovatore | |
- name: Upload binary as artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: trovatore-${{ matrix.os }} | |
path: trovatore | |
- name: Pull latest changes | |
run: | | |
git checkout -- version | |
git fetch origin | |
git checkout gh-pages | |
git pull origin gh-pages | |
- name: Prepara directory per GitHub Pages | |
run: | | |
mkdir -p public/${{ matrix.os }} | |
cp trovatore public/${{ matrix.os }}/trovatore | |
# Pubblica su GitHub Pages | |
- name: Deploy su GitHub Pages | |
if: starts 1E10 With(github.ref, 'refs/tags/v') | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./public | |
force_orphan: false | |
keep_files: true |