Skip to content

Release October (Linux amd64) #18

Release October (Linux amd64)

Release October (Linux amd64) #18

Workflow file for this run

name: Release October (Linux)
on:
release:
types: [published]
jobs:
release:
name: Release October (Linux)
runs-on: ubuntu-latest
strategy:
matrix:
platform:
- linux/amd64
- linux/arm64
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Normalise platform tag
id: normalise_platform
shell: bash
run: |
tag=$(echo ${{ matrix.platform }} | sed -e 's/\//_/g')
echo "::set-output name=tag::$tag"
- name: Normalise version tag
id: normalise_version
shell: bash
run: |
version=$(echo ${{ github.event.release.tag_name }} | sed -e 's/v//g')
echo "::set-output name=version::$version"
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.19
- 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
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: '20.8.0'
- name: Build frontend assets
shell: bash
run: |
npm install -g npm
node version.js ${{ github.event.release.tag_name }}
cd frontend && npm install
- name: Build wails app for Linux
shell: bash
run: CGO_ENABLED=1 wails build -platform ${{ matrix.platform }} -ldflags "-X main.version=${{ github.event.release.tag_name }}"
- name: Package up deb file
shell: bash
run: |
mv build/bin/october build/linux/october_0.0.0_amd64/usr/local/bin/
cd build/linux
mv october_0.0.0_amd64 "october_${{ steps.normalise_version.outputs.version }}_amd64"
sed -i 's/0.0.0/${{ steps.normalise_version.outputs.version }}/g' "october_${{ steps.normalise_version.outputs.version }}_amd64/DEBIAN/control"
dpkg-deb --build "october_${{ steps.normalise_version.outputs.version }}_amd64"
- name: Get latest release from API
id: get_upload_url
shell: bash
run: |
curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/marcus-crane/october/releases" > /tmp/releases.json
url=$(jq -r '.[0].upload_url' /tmp/releases.json)
echo "::set-output name=url::$url"
- name: Upload artifact
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ARTIFACT_NAME: october_${{ steps.normalise_version.outputs.version }}_${{ steps.normalise_platform.outputs.tag }}
with:
upload_url: ${{ steps.get_upload_url.outputs.url }}
asset_path: ./build/linux/october_${{ steps.normalise_version.outputs.version }}_amd64.deb
asset_name: ${{ env.ARTIFACT_NAME }}.deb
asset_content_type: application/octet-stream