Skip to content

Commit

Permalink
Create new build file that builds latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
hsource committed Dec 30, 2023
1 parent 19d58eb commit 957a31f
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
34 changes: 34 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: build

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:

runs-on: macos-12

steps:
- uses: actions/checkout@v3
- run: brew install make ninja
- run: make tools
- run: make clean
- run: make
- run: make sign
- run: zip -r PathOfBuilding.zip PathOfBuilding.app
# Based on https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter
- id: get-version
run: |
version=$(sed -n 's/^.*number="\([0-9.]*\)".*$/\1/p' PathOfBuilding/manifest.xml)
echo "VERSION=$version" >> "$GITHUB_OUTPUT"
- name: Upload MacOS artifacts into Github
uses: ncipollo/release-action@v1
with:
artifacts: "PathOfBuilding.zip"
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
tag: v${{ steps.get-version.outputs.VERSION }}
if: github.ref == 'refs/heads/master'
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,12 @@ pob: load_pob luacurl frontend
frontend:
arch=x86_64 meson -Dbuildtype=release --prefix=${DIR}/PathOfBuilding.app --bindir=Contents/MacOS build

# We checkout the latest version.
load_pob:
git clone https://github.com/PathOfBuildingCommunity/PathOfBuilding.git; \
pushd PathOfBuilding; \
git add . && git fetch && git reset --hard origin/dev; \
git fetch; \
git add . && git reset --hard HEAD && git checkout $$(git describe --tags $$(git rev-list --tags --max-count=1)); \
popd

luacurl:
Expand Down

0 comments on commit 957a31f

Please sign in to comment.