Skip to content

Commit

Permalink
Merge pull request #104 from marcus-crane/test-artifacts
Browse files Browse the repository at this point in the history
Test building artifacts during PRs
  • Loading branch information
marcus-crane authored Dec 17, 2023
2 parents ce59969 + 0523c06 commit c26e9ff
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
1 change: 1 addition & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: Publish docs
on:
workflow_dispatch:
push:
branches: [main]
release:
types: [released]
jobs:
Expand Down
28 changes: 19 additions & 9 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@ jobs:
strategy:
matrix:
build:
- platform: 'linux/amd64'
os: 'ubuntu-latest'
# - platform: darwin/amd64
# os: macos-latest
# - platform: darwin/arm64
# os: macos-latest
# - platform: darwin/universal
# os: macos-latest
- platform: linux/amd64
os: ubuntu-latest
runs-on: ${{ matrix.build.os }}
name: Release October (${{ matrix.build.platform }})
steps:
Expand All @@ -28,7 +34,11 @@ jobs:
id: normalise_version
shell: bash
run: |
version=$(echo ${{ github.event.release.tag_name }} | sed -e 's/v//g')
if [ -n "${{ github.event.release.tag_name }}" ]; then
version=$(echo ${{ github.event.release.tag_name }} | sed -e 's/v//g')
else
version="1.0.0"
fi
echo "::set-output name=version::$version"
- name: Set up Go
Expand All @@ -39,10 +49,10 @@ jobs:
- name: Install wails
shell: bash
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest

- name: Install Ubuntu prerequisites
shell: bash
run: sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev
run: sudo apt-get update && sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev

- name: Set up Node
uses: actions/setup-node@v4
Expand All @@ -53,13 +63,13 @@ jobs:
shell: bash
run: |
npm install -g npm
node version.js ${{ github.event.release.tag_name }}
node version.js "v${{ steps.normalise_version.outputs.version }}"
cd frontend && npm install
- name: Build wails app for Linux
if: runner.os == 'Linux'
shell: bash
run: wails build -platform ${{ matrix.platform }} -ldflags "-X main.version=${{ github.event.release.tag_name }}"
run: wails build -platform ${{ matrix.build.platform }} -ldflags "-X main.version=v${{ steps.normalise_version.outputs.version }}"

- name: Package up deb file
if: runner.os == 'Linux'
Expand All @@ -73,12 +83,12 @@ jobs:
dpkg-deb --build "october_${{ steps.normalise_version.outputs.version }}_amd64"
- name: Upload build artifact
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
uses: actions/upload-artifact@v3
with:
name: october_${{ steps.normalise_version.outputs.version }}_${{ steps.normalise_platform.outputs.tag }}
name: october_pr${{ github.event.pull_request.number }}_${{ github.event.pull_request.head.sha }}_${{ steps.normalise_platform.outputs.tag }}
path: |
./build/linux/october_${{ steps.normalise_version.outputs.version }}_amd64.deb
- name: Get latest release from API
if: startsWith(github.ref, 'refs/tags/')
Expand Down
4 changes: 1 addition & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,4 @@ require (
modernc.org/mathutil v1.5.0 // indirect
modernc.org/memory v1.5.0 // indirect
modernc.org/sqlite v1.23.1 // indirect
)

// replace github.com/wailsapp/wails/v2 v2.0.0-beta.37 => /Users/marcus/Code/go/pkg/mod/github.com/wailsapp/wails/[email protected]
)

0 comments on commit c26e9ff

Please sign in to comment.