Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
a1d7e78
Automate building an RPM package
mapitman Dec 2, 2025
682fddd
Update method for determining version
mapitman Dec 2, 2025
50461e4
Force go build to not attempt to embed VCS info
mapitman Dec 2, 2025
64951ed
Fix RPM build error
mapitman Dec 2, 2025
578ba29
Fix RPM build errors
mapitman Dec 2, 2025
436a533
Try to fix build error
mapitman Dec 2, 2025
2398b6f
Try to fix build error again
mapitman Dec 2, 2025
a586442
fix(ci): stream repo into containers for ci-sim targets to avoid moun…
mapitman Dec 14, 2025
4da88bb
chore(ci): mark ci simulation scripts executable
mapitman Dec 14, 2025
7835571
fix(ci): sanitize VERSION for rpm builds (replace illegal chars)
mapitman Dec 14, 2025
fd0f3b9
fix(ci): pass expanded RPM_VERSION to rpmbuild and fix echo
mapitman Dec 14, 2025
c43b481
ci: stop building RPMs on every push (handled in release workflow)
mapitman Dec 14, 2025
8acab0a
ci: remove duplicate rpm-build workflow (release handles RPMs)
mapitman Dec 14, 2025
6caf2fe
fix(ci): mark repo safe for git before RPM build to fix git archive
mapitman Dec 14, 2025
1d51e2e
docs: consolidate documentation into fewer files
mapitman Dec 15, 2025
c1fd679
Initial plan
Copilot Dec 15, 2025
0f6b0b5
fix(ci): add workflow_dispatch trigger with version input to build wo…
Copilot Dec 15, 2025
3a6bf08
Update Makefile
mapitman Dec 15, 2025
7a54117
Update Makefile
mapitman Dec 15, 2025
cb1fa3f
Update Makefile
mapitman Dec 15, 2025
10642be
Update Makefile
mapitman Dec 15, 2025
fb698bf
Update build-rpm.sh
mapitman Dec 15, 2025
48e8276
Update scripts/ci-sim-fedora.sh
mapitman Dec 15, 2025
3907608
Update scripts/ci-sim-ubuntu.sh
mapitman Dec 15, 2025
0b7e1f9
Improve dependency checking with actual command names
Copilot Dec 15, 2025
b04a4c1
Improve comment clarity in check_dependencies
Copilot Dec 15, 2025
90c6e52
Fix tar command to handle VERSION with forward slashes
Copilot Dec 15, 2025
41fbafb
fix: correct tar transform syntax to use proper sed-style delimiters
Copilot Dec 15, 2025
fa0745e
fix(ci): sanitize VERSION to replace slashes with dashes
Copilot Dec 15, 2025
6a443e4
Merge branch 'fedora-package' into copilot/sub-pr-43
Copilot Dec 15, 2025
e352cda
refactor(ci): remove redundant VERSION sanitization from workflow
Copilot Dec 15, 2025
aa9347b
Merge pull request #44 from mapitman/copilot/sub-pr-43
mapitman Dec 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 26 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,41 @@ name: Build

on:
push:
workflow_dispatch:
inputs:
version:
description: 'Version to build (e.g., 1.0.0)'
required: false
type: string

jobs:
build:
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: 'Get Previous tag'
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
- name: Set version
- name: Determine version
id: version
run: |
export VERSION=${{ steps.previoustag.outputs.tag }}
# For manual runs (workflow_dispatch) allow explicit version; otherwise use the ref name
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
VERSION="${{ github.event.inputs.version }}"
Comment on lines +20 to +22
Copy link

Copilot AI Dec 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow checks for workflow_dispatch event but the workflow does not declare workflow_dispatch in its triggers (only push is declared). This means the condition will never be true, and the github.event.inputs.version will never be used. Either add workflow_dispatch to the trigger list or remove this unused conditional logic.

Copilot uses AI. Check for mistakes.
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot open a new pull request to apply changes based on this feedback

else
VERSION="${{ github.ref_name }}"
fi
# strip any leading v
VERSION="${VERSION#v}"
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT

- name: Show chosen version
run: |
echo "Resolved VERSION=${{ steps.version.outputs.VERSION }}"
- name: Setup tools
run: sudo apt-get install pandoc
run: sudo apt-get install -y pandoc
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Build
run: VERSION="${{ steps.previoustag.outputs.tag }}" make all
run: VERSION="${{ steps.version.outputs.VERSION }}" make all


205 changes: 110 additions & 95 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,112 +4,127 @@ on:
push:
tags:
- '*'

jobs:
build:
build-binaries:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: 'Get Previous tag'
id: previoustag
uses: "WyriHaximus/github-action-get-previous-tag@v1"
- name: Get tag version
id: version
run: |
VERSION="${{ github.ref_name }}"
# Remove leading 'v' if present
VERSION="${VERSION#v}"
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT

- name: Show chosen version
run: |
echo "Resolved VERSION=${{ steps.version.outputs.VERSION }}"

- name: Setup tools
run: sudo apt-get install pandoc
run: sudo apt-get install -y pandoc

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Build
run: |
VERSION="${{ steps.previoustag.outputs.tag }}" make all
VERSION="${{ steps.previoustag.outputs.tag }}" make deb
- name: Release
uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: true
prerelease: false
release_name: ${{ steps.previoustag.outputs.tag }}
tag_name: ${{ steps.previoustag.outputs.tag }}
- name: upload linux amd64 artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./mdview-${{ steps.previoustag.outputs.tag }}-linux-amd64.tar.gz
asset_name: mdview-${{ steps.previoustag.outputs.tag }}-linux-amd64.tar.gz
asset_content_type: application/gzip
- name: upload linux i386 artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./mdview-${{ steps.previoustag.outputs.tag }}-linux-i386.tar.gz
asset_name: mdview-${{ steps.previoustag.outputs.tag }}-linux-i386.tar.gz
asset_content_type: application/gzip
- name: upload linux arm64 artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./mdview-${{ steps.previoustag.outputs.tag }}-linux-arm64.tar.gz
asset_name: mdview-${{ steps.previoustag.outputs.tag }}-linux-arm64.tar.gz
asset_content_type: application/gzip
- name: upload darwin amd64 artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./mdview-${{ steps.previoustag.outputs.tag }}-darwin-amd64.tar.gz
asset_name: mdview-${{ steps.previoustag.outputs.tag }}-darwin-amd64.tar.gz
asset_content_type: application/gzip
- name: upload darwin arm64 artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Build all binaries
run: VERSION=${{ steps.version.outputs.VERSION }} make all deb

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./mdview-${{ steps.previoustag.outputs.tag }}-darwin-arm64.tar.gz
asset_name: mdview-${{ steps.previoustag.outputs.tag }}-darwin-arm64.tar.gz
asset_content_type: application/gzip
- name: upload windows amd64 artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
name: binaries
path: |
mdview-*.tar.gz
mdview-*.zip
mdview_*.deb

build-rpm:
runs-on: ubuntu-latest
container:
image: fedora:latest
steps:
- name: Install dependencies
run: |
dnf install -y \
rpm-build \
golang \
pandoc \
make \
git \
tar \
gzip

- name: Checkout code
uses: actions/checkout@v4

- name: Mark repo safe for git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"

- name: Get tag version
id: version
run: |
VERSION="${{ github.ref_name }}"
VERSION="${VERSION#v}"
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT

- name: Show chosen version
run: |
echo "Resolved VERSION=${{ steps.version.outputs.VERSION }}"

- name: Build RPM package
run: VERSION=${{ steps.version.outputs.VERSION }} make rpm

- name: Copy RPMs to workspace
run: |
mkdir -p dist
cp ${HOME}/rpmbuild/RPMS/x86_64/mdview-*.x86_64.rpm dist/ || true
cp ${HOME}/rpmbuild/SRPMS/mdview-*.src.rpm dist/ || true
ls -lh dist/

- name: Upload RPM artifacts
uses: actions/upload-artifact@v4
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./mdview-${{ steps.previoustag.outputs.tag }}-windows-amd64.zip
asset_name: mdview-${{ steps.previoustag.outputs.tag }}-windows-amd64.zip
asset_content_type: application/zip
- name: upload freebsd amd64 artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
name: rpm-packages
path: dist/mdview-*.rpm

release:
needs: [build-binaries, build-rpm]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Get tag version
id: version
run: |
VERSION="${{ github.ref_name }}"
VERSION="${VERSION#v}"
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT

- name: Show chosen version
run: |
echo "Resolved VERSION=${{ steps.version.outputs.VERSION }}"

- name: Download all artifacts
uses: actions/download-artifact@v4
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./mdview-${{ steps.previoustag.outputs.tag }}-freebsd-amd64.tar.gz
asset_name: mdview-${{ steps.previoustag.outputs.tag }}-freebsd-amd64.tar.gz
asset_content_type: application/gzip
- name: upload linux amd64 deb
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
path: release-files

- name: Prepare release files
run: |
mkdir -p release
cp release-files/binaries/* release/ || true
cp release-files/rpm-packages/* release/ || true
ls -lh release/

- name: Create Release
uses: softprops/action-gh-release@v1
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./mdview_${{ steps.previoustag.outputs.tag }}_amd64.deb
asset_name: mdview_${{ steps.previoustag.outputs.tag }}_amd64.deb
asset_content_type: application/vnd.debian.binary-package
- name: upload linux arm64 deb
uses: actions/upload-release-asset@v1
files: release/*
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./mdview_${{ steps.previoustag.outputs.tag }}_arm64.deb
asset_name: mdview_${{ steps.previoustag.outputs.tag }}_arm64.deb
asset_content_type: application/vnd.debian.binary-package
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ parts/
package/*
*.deb
mdview.1
dist/
Loading