From a30a6ff0d198d1fd57b3fb15fc0c30c7855b25eb Mon Sep 17 00:00:00 2001 From: Sunset Mikoto <26019675+SunsetMkt@users.noreply.github.com> Date: Tue, 26 Aug 2025 00:13:12 +0800 Subject: [PATCH 1/4] feat: build workflow --- .github/workflows/build.yml | 147 ++++++++++++++++++++++++++++++++++++ 1 file changed, 147 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..c7f8c8b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,147 @@ +name: Build + +on: + push: + branches: [master] + pull_request: + branches: [master] + # release: + # types: [published] + workflow_dispatch: + +jobs: + build-linux: + name: Build Linux + runs-on: ubuntu-latest + strategy: + matrix: + arch: + - { name: amd64, target: x86_64-linux-gnu, apt: gcc } + - { + name: arm64, + target: aarch64-linux-gnu, + apt: gcc-aarch64-linux-gnu, + } + - { + name: ppc64le, + target: powerpc64le-linux-gnu, + apt: gcc-powerpc64le-linux-gnu, + } + - { + name: s390x, + target: s390x-linux-gnu, + apt: gcc-s390x-linux-gnu, + } + - { + name: riscv64, + target: riscv64-linux-gnu, + apt: gcc-riscv64-linux-gnu, + } + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install cross-compilation toolchain + run: | + sudo apt-get update + sudo apt-get install -y ${{ matrix.arch.apt }} + + - name: Build all & vlmcsdmulti + run: | + if [ "${{ matrix.arch.name }}" = "amd64" ]; then + # Native build for amd64 + make clean + make all vlmcsdmulti STRIP=0 + else + # Cross-compilation for other architectures + make clean + make all vlmcsdmulti CC=${{ matrix.arch.target }}-gcc STRIP=0 + fi + + - name: Prepare artifacts + run: | + mkdir -p artifacts/linux-${{ matrix.arch.name }} + cp -r bin artifacts/linux-${{ matrix.arch.name }} + cp -r lib artifacts/linux-${{ matrix.arch.name }} + + - name: Upload Linux artifacts + uses: actions/upload-artifact@v4 + with: + name: vlmcsd-linux-${{ matrix.arch.name }} + path: artifacts/linux-${{ matrix.arch.name }}/ + retention-days: 30 + + build-windows: + name: Build Windows + runs-on: ubuntu-latest + strategy: + matrix: + arch: + - { + name: amd64, + target: x86_64-w64-mingw32, + apt: gcc-mingw-w64-x86-64, + } + - { + name: x86, + target: i686-w64-mingw32, + apt: gcc-mingw-w64-i686, + } + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install MinGW cross-compilation toolchain + run: | + sudo apt-get update + sudo apt-get install -y ${{ matrix.arch.apt }} + + - name: Build all & vlmcsdmulti for Windows + run: | + make clean + make all vlmcsdmulti CC=${{ matrix.arch.target }}-gcc STRIP=0 + + - name: Prepare artifacts + run: | + mkdir -p artifacts/windows-${{ matrix.arch.name }} + cp -r bin artifacts/windows-${{ matrix.arch.name }} + cp -r lib artifacts/windows-${{ matrix.arch.name }} + + - name: Upload Windows artifacts + uses: actions/upload-artifact@v4 + with: + name: vlmcsd-windows-${{ matrix.arch.name }} + path: artifacts/windows-${{ matrix.arch.name }}/ + retention-days: 30 + + # release: + # name: Create Release Assets + # runs-on: ubuntu-latest + # needs: [build-linux, build-windows] + # if: github.event_name == 'release' + + # steps: + # - name: Download all artifacts + # uses: actions/download-artifact@v4 + # with: + # path: artifacts/ + + # - name: Create release archives + # run: | + # cd artifacts/ + # for dir in */; do + # archive_name="${dir%/}.tar.gz" + # tar -czf "../$archive_name" -C "$dir" . + # done + # cd .. + # ls -la *.tar.gz + + # - name: Upload release assets + # uses: softprops/action-gh-release@v1 + # with: + # files: | + # *.tar.gz + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From cf94728865e956c1eaf0bea771bcdbf4077e68bb Mon Sep 17 00:00:00 2001 From: Sunset Mikoto <26019675+SunsetMkt@users.noreply.github.com> Date: Mon, 1 Sep 2025 12:11:54 +0800 Subject: [PATCH 2/4] feat: ghcr publishing workflow (#10) * feat: ghcr publishing workflow * feat: sign docker image * chore: rename job * fix: revert Dockerfile --- .github/workflows/docker-publish.yml | 107 +++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 .github/workflows/docker-publish.yml diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 0000000..706d200 --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -0,0 +1,107 @@ +name: Build and Publish Docker Image + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +on: + # push: + # branches: [master] + # pull_request: + # branches: [master] + # release: + # types: [published] + workflow_dispatch: + +env: + # Use docker.io for Docker Hub if empty + REGISTRY: ghcr.io + # github.repository as / + IMAGE_NAME: ${{ github.repository }} + +jobs: + docker-publish: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + # This is used to complete the identity challenge + # with sigstore/fulcio when running outside of PRs. + id-token: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + # Install the cosign tool except on PR + # https://github.com/sigstore/cosign-installer + - name: Install cosign + if: github.event_name != 'pull_request' + uses: sigstore/cosign-installer@v3 + + # Set up BuildKit Docker container builder to be able to build + # multi-platform images and export cache + # https://github.com/docker/setup-buildx-action + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + # Login against a Docker registry except on PR + # https://github.com/docker/login-action + - name: Log into registry ${{ env.REGISTRY }} + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + # Extract metadata (tags, labels) for Docker + # https://github.com/docker/metadata-action + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=raw,value=latest,enable={{is_default_branch}} + type=sha + + # Build and push Docker image with Buildx (don't push on PR) + # https://github.com/docker/build-push-action + - name: Build and push Docker image + id: build-and-push + uses: docker/build-push-action@v5 + with: + context: . + file: ./.docker/Dockerfile + platforms: >- + linux/amd64,linux/arm64,linux/ppc64le,linux/s390x,linux/riscv64 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max + + # Sign the resulting Docker image digest except on PRs. + # This will only write to the public Rekor transparency log when the Docker + # repository is public to avoid leaking data. If you would like to publish + # transparency data even for private images, pass --force to cosign below. + # https://github.com/sigstore/cosign + - name: Sign the published Docker image + if: ${{ github.event_name != 'pull_request' }} + env: + # https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable + TAGS: ${{ steps.meta.outputs.tags }} + DIGEST: ${{ steps.build-and-push.outputs.digest }} + # This step uses the identity token to provision an ephemeral certificate + # against the sigstore community Fulcio instance. + run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST} From e3db1f232dd45264c9c184b1729398beca3d1e01 Mon Sep 17 00:00:00 2001 From: Stefan <93658221+dbstf@users.noreply.github.com> Date: Tue, 16 Sep 2025 16:45:52 +0200 Subject: [PATCH 3/4] Update GNUmakefile: Fix build error with VERBOSE=1 (#14) Building with option VERBOSE=1 failed due to incorrect syntax/indentation in line 510. Signed-off-by: Stefan <93658221+dbstf@users.noreply.github.com> Co-authored-by: Shiroi Neko --- src/GNUmakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GNUmakefile b/src/GNUmakefile index b8340ab..83a7167 100644 --- a/src/GNUmakefile +++ b/src/GNUmakefile @@ -507,7 +507,7 @@ endif ../build/%.o: %.c ifeq ($(VERBOSE),1) +$(CC) -x$(COMPILER_LANGUAGE) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -c $< -o $@ - $(CC) -S $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -o ../build/$*.asm $< + +$(CC) -S $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -o ../build/$*.asm $< ifeq ($(DEPENDENCIES),1) +$(CC) -x$(COMPILER_LANGUAGE) $(PLATFORMFLAGS) $(BASECFLAGS) $(CFLAGS) $(PLATFORMFLAGS) -MM -MF $*.d $< -MT $@ endif From c440eb7d02de89d8f426fbcf489a1fe99668ecb6 Mon Sep 17 00:00:00 2001 From: "VLTA of @TheFlightSims" Date: Tue, 23 Sep 2025 14:27:55 +0700 Subject: [PATCH 4/4] Update install.sh Update for systemd service for * Documentation correctness * ExecStart with logging into files (systemd logging only start and stop) Signed-off-by: VLTA of @TheFlightSims --- .systemd/install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.systemd/install.sh b/.systemd/install.sh index 0034055..8e160bf 100644 --- a/.systemd/install.sh +++ b/.systemd/install.sh @@ -56,14 +56,14 @@ mkdir -p /etc/systemd/system cat < /etc/systemd/system/vlmcsd.service [Unit] Description=Volume License Management Service -Documentation=https://github.com/tfslabs/vlmcsd +Documentation=https://github.com/tfslabs/vlmcsd/wiki After=network.target StartLimitBurst=3 StartLimitIntervalSec=60 [Service] Type=simple -ExecStart=/usr/bin/vlmcsd -P 1688 -H 26100 -C 1033 -l /var/log/vlmcsd.log -T1 -e -D +ExecStart=/usr/bin/vlmcsd -P 1688 -H 26100 -C 1033 -l /tmp/vlmcsd.log -T1 -v -D TimeoutStartSec=0 RestartSec=2 Restart=always @@ -77,4 +77,4 @@ systemctl daemon-reload echo "Enabling and starting vlmcsd service..." systemctl enable --now vlmcsd -echo "Installation complete!" \ No newline at end of file +echo "Installation complete!"