From 49a6d7000f9e6d7775ddba6dec0c6100256c20af Mon Sep 17 00:00:00 2001 From: Blockmaster2706 Date: Fri, 3 Apr 2026 17:06:54 +0200 Subject: [PATCH 1/4] create GitHub Actions workflow for automated releases --- .github/workflows/release.yml | 47 +++++++++++++++++++++++++++++++++++ build.sh | 18 +++++++++++++- 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..7a251fb --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,47 @@ +name: Build and Release + +on: + push: + tags: + - 'v*' + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + arch: [arm64, armv7h] + + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.21' + + - name: Install Qt dependencies + run: | + sudo apt-get update + sudo apt-get install -y qt6-tools-dev qttools5-dev + + - name: Build project for ${{ matrix.arch }} + run: | + chmod +x build.sh + ./build.sh ${{ matrix.arch }} + + - name: Create release archive + run: | + ARCH=${{ matrix.arch }} + ZIP_NAME="reMarkdown-${ARCH}-${{ github.ref_name }}.zip" + cd rmd + zip -r "../${ZIP_NAME}" backend manifest.json resources.rcc + cd .. + echo "ZIP_FILE=${ZIP_NAME}" >> $GITHUB_ENV + + - name: Upload release assets + uses: softprops/action-gh-release@v1 + with: + files: ${{ env.ZIP_FILE }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/build.sh b/build.sh index 18a6e5f..2eaa0d5 100755 --- a/build.sh +++ b/build.sh @@ -1,8 +1,24 @@ #!/bin/bash + +# Default to arm64 if no architecture is specified +ARCH=${1:-arm64} + +# Validate architecture +if [[ "$ARCH" != "arm64" && "$ARCH" != "armv7h" ]]; then + echo "Error: Unsupported architecture '$ARCH'. Supported: arm64, armv7h" + exit 1 +fi + +echo "Building for architecture: $ARCH" + rm -rf rmd mkdir -p rmd/backend cp manifest.json rmd cp icon.png rmd rcc --binary -o rmd/resources.rcc application.qrc -GOOS=linux GOARCH=arm64 go build . + +# Build the Go binary for the specified architecture +GOOS=linux GOARCH=$ARCH go build -o remarkdown . cp remarkdown rmd/backend/entry + +echo "Build completed successfully for $ARCH" From 4241ab3050872b9dc2d83c5a259db362d0160422 Mon Sep 17 00:00:00 2001 From: Blockmaster2706 Date: Fri, 3 Apr 2026 17:08:47 +0200 Subject: [PATCH 2/4] simplify trigger for build and release workflow --- .github/workflows/release.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7a251fb..14b8285 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,9 +1,6 @@ name: Build and Release -on: - push: - tags: - - 'v*' +on: push jobs: build: From 6a88473d38293b7cb4372962064504e89f434384 Mon Sep 17 00:00:00 2001 From: Blockmaster2706 Date: Fri, 3 Apr 2026 17:11:40 +0200 Subject: [PATCH 3/4] Enhance build process with version generation and architecture validation --- .github/workflows/release.yml | 12 +++++++++++- build.sh | 14 +++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 14b8285..69968fa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,6 +12,14 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Generate version + id: version + run: | + # Generate semantic version based on date and run number + VERSION="0.1.${{ github.run_number }}" + echo "version=${VERSION}" >> $GITHUB_OUTPUT + echo "Generated version: ${VERSION}" + - name: Set up Go uses: actions/setup-go@v4 with: @@ -30,7 +38,8 @@ jobs: - name: Create release archive run: | ARCH=${{ matrix.arch }} - ZIP_NAME="reMarkdown-${ARCH}-${{ github.ref_name }}.zip" + VERSION=${{ steps.version.outputs.version }} + ZIP_NAME="reMarkdown-${ARCH}-${VERSION}.zip" cd rmd zip -r "../${ZIP_NAME}" backend manifest.json resources.rcc cd .. @@ -39,6 +48,7 @@ jobs: - name: Upload release assets uses: softprops/action-gh-release@v1 with: + tag_name: v${{ steps.version.outputs.version }} files: ${{ env.ZIP_FILE }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/build.sh b/build.sh index 2eaa0d5..b192939 100755 --- a/build.sh +++ b/build.sh @@ -18,7 +18,19 @@ cp icon.png rmd rcc --binary -o rmd/resources.rcc application.qrc # Build the Go binary for the specified architecture -GOOS=linux GOARCH=$ARCH go build -o remarkdown . +if [[ "$ARCH" == "armv7h" ]]; then + # armv7h uses GOARCH=arm with GOARM=7 + GOOS=linux GOARCH=arm GOARM=7 go build -o remarkdown . +else + # arm64 maps directly + GOOS=linux GOARCH=$ARCH go build -o remarkdown . +fi + +if [ ! -f remarkdown ]; then + echo "Error: Build failed - remarkdown binary not created" + exit 1 +fi + cp remarkdown rmd/backend/entry echo "Build completed successfully for $ARCH" From 43f4343cb9ba0a7f3476d8cab467db223b48aede Mon Sep 17 00:00:00 2001 From: Blockmaster2706 <96124793+Blockmaster2706@users.noreply.github.com> Date: Mon, 6 Apr 2026 14:30:07 +0200 Subject: [PATCH 4/4] Add icon.png to release zip file --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 69968fa..34696b4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,7 +41,7 @@ jobs: VERSION=${{ steps.version.outputs.version }} ZIP_NAME="reMarkdown-${ARCH}-${VERSION}.zip" cd rmd - zip -r "../${ZIP_NAME}" backend manifest.json resources.rcc + zip -r "../${ZIP_NAME}" backend manifest.json resources.rcc icon.png cd .. echo "ZIP_FILE=${ZIP_NAME}" >> $GITHUB_ENV