Test on vcpkg 261f5b1fcc106428df91d2f44f2bec9e50e11868 #51
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] | |
env: | |
VCPKG_COMMIT_HASH: 261f5b1fcc106428df91d2f44f2bec9e50e11868 | |
jobs: | |
createrelease: | |
name: createrelease | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Get the version | |
id: get_version | |
run: echo "version=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV | |
- name: create release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: v${{ env.version }} | |
release_name: Release v${{ env.version }} | |
prerelease: false | |
- name: Output Release URL File | |
run: echo "${{ steps.create_release.outputs.upload_url }}" > release_url.txt | |
- name: Save Release URL File for publish | |
uses: actions/upload-artifact@v1 | |
with: | |
name: release_url | |
path: release_url.txt | |
macos: | |
name: macOS | |
runs-on: macos-latest | |
needs: createrelease | |
if: always() | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Get the version | |
if: startsWith(github.ref, 'refs/tags/v') | |
run: echo "version=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV | |
- name: Install vcpkg and packages | |
id: macos_build | |
shell: bash | |
run: | | |
export VCPKG_COMMIT_HASH='${{ env.VCPKG_COMMIT_HASH }}' | |
brew install automake autoconf-archive | |
./macos_build.sh | |
- name: Upload zip as artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: openrct2-libs-v${{ env.version }}-universal-macos-dylibs.zip | |
path: openrct2-libs-v${{ env.version }}-universal-macos-dylibs.zip | |
- name: Load Release URL File from release job | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: actions/download-artifact@v1 | |
with: | |
name: release_url | |
- name: Get Release File Name & Upload URL | |
if: startsWith(github.ref, 'refs/tags/v') | |
id: get_release_info | |
shell: bash | |
run: | | |
value=`cat release_url/release_url.txt` | |
echo ::set-output name=upload_url::$value | |
- name: Upload Release Asset | |
if: startsWith(github.ref, 'refs/tags/v') | |
id: upload-release-asset | |
uses: actions/upload-release-asset@v1.0.2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.get_release_info.outputs.upload_url }} | |
asset_path: openrct2-libs-v${{ env.version }}-universal-macos-dylibs.zip | |
asset_name: openrct2-libs-v${{ env.version }}-universal-macos-dylibs.zip | |
asset_content_type: application/zip |