Skip to content

docs: publish user guide for v1.6.1 #225

docs: publish user guide for v1.6.1

docs: publish user guide for v1.6.1 #225

Workflow file for this run

name: Build
on:
push:
workflow_dispatch:
permissions:
contents: write
jobs:
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install Wails
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
- name: Get version
id: version
run: echo "VERSION=${GITHUB_REF_NAME:-dev}" >> $GITHUB_OUTPUT
- name: Set version in wails.json
run: |
VERSION=${{ steps.version.outputs.VERSION }}
VERSION=${VERSION#v}
jq --arg v "$VERSION" '.info.productVersion = $v | .info.productName = "reManager"' wails.json > tmp.json && mv tmp.json wails.json
- name: Build universal binary
run: |
wails build -platform darwin/universal \
-ldflags "-X main.version=${{ steps.version.outputs.VERSION }}"
- name: Import certificate
uses: apple-actions/import-codesign-certs@v3
with:
p12-file-base64: ${{ secrets.APPLE_CERTIFICATE_BASE64 }}
p12-password: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
- name: Code sign
run: |
codesign --deep --force --verify --verbose \
--sign "Developer ID Application: Robert Scott (${{ secrets.APPLE_TEAM_ID }})" \
--options runtime \
--entitlements build/darwin/entitlements.plist \
build/bin/reManager.app
- name: Create ZIP for notarization
run: |
cd build/bin
ditto -c -k --keepParent reManager.app reManager-macos-universal.zip
- name: Store API key
if: startsWith(github.ref, 'refs/tags/') && !endsWith(github.ref_name, '-test')
run: |
mkdir -p ~/private_keys
echo -n "${{ secrets.APPLE_API_KEY_BASE64 }}" | base64 --decode -o ~/private_keys/AuthKey_${{ secrets.APPLE_API_KEY_ID }}.p8
- name: Notarize
if: startsWith(github.ref, 'refs/tags/') && !endsWith(github.ref_name, '-test')
run: |
xcrun notarytool submit build/bin/reManager-macos-universal.zip \
--key ~/private_keys/AuthKey_${{ secrets.APPLE_API_KEY_ID }}.p8 \
--key-id ${{ secrets.APPLE_API_KEY_ID }} \
--issuer ${{ secrets.APPLE_API_ISSUER_ID }} \
--wait \
--timeout 2h
- name: Staple
if: startsWith(github.ref, 'refs/tags/') && !endsWith(github.ref_name, '-test')
run: xcrun stapler staple build/bin/reManager.app
- name: Re-create ZIP with stapled app
if: startsWith(github.ref, 'refs/tags/') && !endsWith(github.ref_name, '-test')
run: |
cd build/bin
rm reManager-macos-universal.zip
ditto -c -k --keepParent reManager.app reManager-macos-universal.zip
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: reManager-macos-universal
path: build/bin/reManager-macos-universal.zip
build-linux-amd64:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev
- name: Install Wails
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
- name: Get version
id: version
run: echo "VERSION=${GITHUB_REF_NAME:-dev}" >> $GITHUB_OUTPUT
- name: Set version in wails.json
run: |
VERSION=${{ steps.version.outputs.VERSION }}
VERSION=${VERSION#v}
jq --arg v "$VERSION" '.info.productVersion = $v | .info.productName = "reManager"' wails.json > tmp.json && mv tmp.json wails.json
- name: Build
run: |
wails build -platform linux/amd64 \
-tags webkit2_41 \
-ldflags "-X main.version=${{ steps.version.outputs.VERSION }}"
- name: Compress
run: |
cd build/bin
tar -czvf reManager-linux-amd64.tar.gz reManager
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: reManager-linux-amd64
path: build/bin/reManager-linux-amd64.tar.gz
build-linux-arm64:
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev
- name: Install Wails
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
- name: Get version
id: version
run: echo "VERSION=${GITHUB_REF_NAME:-dev}" >> $GITHUB_OUTPUT
- name: Set version in wails.json
run: |
VERSION=${{ steps.version.outputs.VERSION }}
VERSION=${VERSION#v}
jq --arg v "$VERSION" '.info.productVersion = $v | .info.productName = "reManager"' wails.json > tmp.json && mv tmp.json wails.json
- name: Build
run: |
wails build -platform linux/arm64 \
-tags webkit2_41 \
-ldflags "-X main.version=${{ steps.version.outputs.VERSION }}"
- name: Compress
run: |
cd build/bin
tar -czvf reManager-linux-arm64.tar.gz reManager
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: reManager-linux-arm64
path: build/bin/reManager-linux-arm64.tar.gz
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install Wails
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
- name: Get version
id: version
shell: bash
run: echo "VERSION=${GITHUB_REF_NAME:-dev}" >> $GITHUB_OUTPUT
- name: Set version in wails.json
shell: bash
run: |
VERSION=${{ steps.version.outputs.VERSION }}
VERSION=${VERSION#v}
jq --arg v "$VERSION" '.info.productVersion = $v | .info.productName = "reManager"' wails.json > tmp.json && mv tmp.json wails.json
- name: Build
run: |
wails build -platform windows/amd64 `
-ldflags "-X main.version=${{ steps.version.outputs.VERSION }}"
- name: Compress
run: Compress-Archive -Path build\bin\reManager.exe -DestinationPath build\bin\reManager-windows-amd64.zip
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: reManager-windows-amd64
path: build/bin/reManager-windows-amd64.zip
build-windows-arm64:
runs-on: windows-11-arm
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25'
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install Wails
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
- name: Get version
id: version
shell: bash
run: echo "VERSION=${GITHUB_REF_NAME:-dev}" >> $GITHUB_OUTPUT
- name: Set version in wails.json
shell: bash
run: |
VERSION=${{ steps.version.outputs.VERSION }}
VERSION=${VERSION#v}
jq --arg v "$VERSION" '.info.productVersion = $v | .info.productName = "reManager"' wails.json > tmp.json && mv tmp.json wails.json
- name: Build
run: |
wails build -platform windows/arm64 `
-ldflags "-X main.version=${{ steps.version.outputs.VERSION }}"
- name: Compress
run: Compress-Archive -Path build\bin\reManager.exe -DestinationPath build\bin\reManager-windows-arm64.zip
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: reManager-windows-arm64
path: build/bin/reManager-windows-arm64.zip
build-flatpak-x86_64:
runs-on: ubuntu-latest
container:
image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-49
options: --privileged
steps:
- uses: actions/checkout@v4
- name: Build Flatpak
uses: flatpak/flatpak-github-actions/flatpak-builder@v6
with:
bundle: reManager.flatpak
manifest-path: flatpak/io.scottlabs.reManager.yml
arch: x86_64
cache-key: flatpak-builder-x86_64-${{ github.sha }}
build-flatpak-aarch64:
runs-on: ubuntu-24.04-arm
container:
image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-49
options: --privileged
steps:
- uses: actions/checkout@v4
- name: Build Flatpak
uses: flatpak/flatpak-github-actions/flatpak-builder@v6
with:
bundle: reManager.flatpak
manifest-path: flatpak/io.scottlabs.reManager.yml
arch: aarch64
cache-key: flatpak-builder-aarch64-${{ github.sha }}
release:
needs: [build-macos, build-linux-amd64, build-linux-arm64, build-windows, build-windows-arm64, build-flatpak-x86_64, build-flatpak-aarch64]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/') && !endsWith(github.ref_name, '-test')
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install git-cliff
uses: taiki-e/install-action@git-cliff
- name: Generate changelog
id: changelog
run: |
{
echo 'CHANGELOG<<EOF'
git cliff --config-url https://gist.githubusercontent.com/rmitchellscott/823c46de7a1c3e6d57e9de90ee00d84a/raw/cliff.toml \
--latest --strip header | tail -n +2
echo EOF
} >> $GITHUB_OUTPUT
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Rename flatpak bundles
run: |
mv artifacts/reManager-x86_64.flatpak/reManager.flatpak artifacts/reManager-x86_64.flatpak/reManager-x86_64.flatpak
mv artifacts/reManager-aarch64.flatpak/reManager.flatpak artifacts/reManager-aarch64.flatpak/reManager-aarch64.flatpak
- name: Create release
uses: softprops/action-gh-release@v2
with:
body: ${{ steps.changelog.outputs.CHANGELOG }}
files: |
artifacts/reManager-macos-universal/reManager-macos-universal.zip
artifacts/reManager-linux-amd64/reManager-linux-amd64.tar.gz
artifacts/reManager-linux-arm64/reManager-linux-arm64.tar.gz
artifacts/reManager-windows-amd64/reManager-windows-amd64.zip
artifacts/reManager-windows-arm64/reManager-windows-arm64.zip
artifacts/reManager-x86_64.flatpak/reManager-x86_64.flatpak
artifacts/reManager-aarch64.flatpak/reManager-aarch64.flatpak
publish-guide:
needs: [release]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/') && !endsWith(github.ref_name, '-test')
steps:
- uses: actions/checkout@v4
with:
ref: main
token: ${{ secrets.GITHUB_TOKEN }}
- name: Publish guide for release version
run: |
VERSION="${GITHUB_REF_NAME#v}"
EPUB="docs/guide/reManager User Guide.epub"
if [ ! -f "$EPUB" ]; then
echo "No guide epub found, skipping"
exit 0
fi
mkdir -p docs/guide/releases
cp "$EPUB" "docs/guide/releases/${VERSION}.epub"
SHA256=$(sha256sum "docs/guide/releases/${VERSION}.epub" | awk '{print $1}')
if [ ! -f docs/guide/guide-manifest.json ]; then
echo '{}' > docs/guide/guide-manifest.json
fi
jq --arg v "$VERSION" --arg h "$SHA256" '.[$v] = {"sha256": $h}' \
docs/guide/guide-manifest.json > tmp-manifest.json \
&& mv tmp-manifest.json docs/guide/guide-manifest.json
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add "docs/guide/releases/${VERSION}.epub" docs/guide/guide-manifest.json
git commit -m "docs: publish user guide for v${VERSION}" || exit 0
git push origin main
update-flathub:
needs: [release]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/') && !endsWith(github.ref_name, '-test')
steps:
- uses: actions/checkout@v4
- name: Install yq
run: |
sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
sudo chmod +x /usr/local/bin/yq
- name: Clone flathub repo
run: |
git clone https://x-access-token:${{ secrets.FLATHUB_PAT }}@github.com/flathub/io.scottlabs.reManager.git flathub-repo
- name: Update flathub files
env:
GH_TOKEN: ${{ github.token }}
run: |
TAG=${{ github.ref_name }}
COMMIT=${{ github.sha }}
cp flatpak/go-sources.yml flathub-repo/
cp flatpak/node-sources.json flathub-repo/
cp flatpak/vendor-modules.txt flathub-repo/
# Transform manifest: dir->git source, add metainfo source, fix install path
# NOTE: node-sources.json and go-sources.yml must be plain strings (not type:file)
# so flatpak-builder expands them as additional sources
yq eval '
.modules[0].sources = [
{"type": "git", "url": "https://github.com/rmitchellscott/reManager.git", "tag": "'"$TAG"'", "commit": "'"$COMMIT"'"},
{"type": "file", "path": "io.scottlabs.reManager.metainfo.xml"},
"node-sources.json",
"go-sources.yml"
] |
.modules[0]."build-commands"[] |= sub("flatpak/io.scottlabs.reManager.metainfo.xml", "io.scottlabs.reManager.metainfo.xml")
' flatpak/io.scottlabs.reManager.yml > flathub-repo/io.scottlabs.reManager.yml
# Generate releases from GitHub and update metainfo.xml
RELEASES_JSON=$(gh release list --json tagName,publishedAt --limit 50 | jq '[.[] | {
"+@version": (.tagName | ltrimstr("v")),
"+@date": (.publishedAt | split("T")[0]),
"url": {
"+@type": "details",
"+content": ("https://github.com/rmitchellscott/reManager/releases/tag/" + .tagName)
}
}]')
yq -p xml -o xml ".component.releases.release = $RELEASES_JSON" \
flatpak/io.scottlabs.reManager.metainfo.xml > flathub-repo/io.scottlabs.reManager.metainfo.xml
- name: Create PR on Flathub
env:
GH_TOKEN: ${{ secrets.FLATHUB_PAT }}
run: |
cd flathub-repo
TAG=${{ github.ref_name }}
BRANCH="update-$TAG"
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git checkout -b "$BRANCH"
git add .
git commit -m "Update to $TAG" || exit 0
git push -u origin "$BRANCH"
gh pr create \
--title "Update to $TAG" \
--body "Automated update from upstream release $TAG" \
--base master \
--head "$BRANCH"