From 07cd80dc9ff38ebb4436afee175e9f0246c88b18 Mon Sep 17 00:00:00 2001 From: Kirill Shklyaev Date: Thu, 12 Sep 2024 18:18:40 +0300 Subject: [PATCH 1/2] bump go version and added conf file in release archive --- .github/workflows/release.yml | 52 +++++++++++++++++------------------ 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 709e6fa..8994cd0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,13 +4,13 @@ on: tags: - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 -name: release +name: Build and release permissions: write-all jobs: build: - name: build release + name: Build release runs-on: ubuntu-22.04 strategy: matrix: @@ -22,47 +22,47 @@ jobs: - windows - darwin go-version: - - '1.22' + - '1.23' include: - arch: amd64 rpm_arch: x86_64 - arch: arm64 rpm_arch: aarch64 - env: - GOPRIVATE: github.com/anyproto + steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v4 + - uses: actions/setup-go@v5 with: go-version: '${{ matrix.go-version }}' check-latest: true - - name: git config - run: git config --global url.https://${{ secrets.ANYTYPE_PAT }}@github.com/.insteadOf https://github.com/ - # build {{ - - name: deps + - name: Install deps run: make deps CGO_ENABLED=0 #- name: unit tests # run: make test CGO_ENABLED=0 - - name: build + - name: Build run: make build CGO_ENABLED=0 BUILD_GOOS=${{ matrix.os}} BUILD_GOARCH=${{ matrix.arch }} # }} - - name: get release version + - name: Get release version id: release-version run: | echo "$GITHUB_REF_NAME" | sed 's|^[a-zA-Z]\+|RELEASE_VERSION=|' >> $GITHUB_OUTPUT echo "$GITHUB_REF_NAME" | sed 's|^[a-zA-Z]\+|RELEASE_VERSION_RPM=|; s|-|_|g' >> $GITHUB_OUTPUT # FPM automatically converts versions for RPM + - name: Copy config file in ./bin + run: cp ./any-sync-network/defaultTemplate.yml ./bin/ + # create asset {{ - - name: create zip archive + - name: Create zip | Windows if: matrix.os == 'windows' run: | zip --junk-paths ${{ github.event.repository.name }}-${{ steps.release-version.outputs.RELEASE_VERSION }}.${{ matrix.os }}-${{ matrix.arch }}.zip bin/* - - name: create tar archive + + - name: Create tar | Linux and Darwin if: matrix.os != 'windows' run: | tar \ @@ -73,7 +73,7 @@ jobs: --file=${{ github.event.repository.name }}-${{ steps.release-version.outputs.RELEASE_VERSION }}.${{ matrix.os }}-${{ matrix.arch }}.tgz \ --directory=bin/ \ . - - name: create package deb + - name: Create package | Deb if: matrix.os == 'linux' uses: fb929/github-action-fpm@master with: @@ -86,7 +86,8 @@ jobs: --input-type dir --output-type deb fpm_args: ./bin - - name: create package rpm + + - name: Create package | Rpm if: matrix.os == 'linux' uses: fb929/github-action-fpm@master with: @@ -101,13 +102,13 @@ jobs: fpm_args: ./bin # }} - - name: debug + - name: Debug run: | ls -al ./ # upload-release-asset {{ - name: Create release and upload asset zip - uses: softprops/action-gh-release@v2.0.4 + uses: softprops/action-gh-release@v2 if: matrix.os == 'windows' with: name: Release ${{ github.ref_name }} @@ -115,12 +116,11 @@ jobs: draft: false prerelease: false # for triggering workflow "push-docker-image-release" - https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow - token: ${{ secrets.ANYTYPE_PAT }} files: | - ./${{ github.event.repository.name }}-${{ steps.release-version.outputs.RELEASE_VERSION }}.${{ matrix.os }}-${{ matrix.arch }}.zip + ${{ github.event.repository.name }}-${{ steps.release-version.outputs.RELEASE_VERSION }}.${{ matrix.os }}-${{ matrix.arch }}.zip - name: Create release and upload asset tgz - uses: softprops/action-gh-release@v2.0.4 + uses: softprops/action-gh-release@v2 if: matrix.os != 'windows' with: name: Release ${{ github.ref_name }} @@ -128,12 +128,11 @@ jobs: draft: false prerelease: false # for triggering workflow "push-docker-image-release" - https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow - token: ${{ secrets.ANYTYPE_PAT }} files: | - ./${{ github.event.repository.name }}-${{ steps.release-version.outputs.RELEASE_VERSION }}.${{ matrix.os }}-${{ matrix.arch }}.tgz + ${{ github.event.repository.name }}-${{ steps.release-version.outputs.RELEASE_VERSION }}.${{ matrix.os }}-${{ matrix.arch }}.tgz - name: Create release and upload assets deb and rpm - uses: softprops/action-gh-release@v2.0.4 + uses: softprops/action-gh-release@v2 if: matrix.os == 'linux' with: name: Release ${{ github.ref_name }} @@ -141,8 +140,7 @@ jobs: draft: false prerelease: false # for triggering workflow "push-docker-image-release" - https://docs.github.com/en/actions/using-workflows/triggering-a-workflow#triggering-a-workflow-from-a-workflow - token: ${{ secrets.ANYTYPE_PAT }} files: | - ./${{ github.event.repository.name }}_${{ steps.release-version.outputs.RELEASE_VERSION }}_${{ matrix.arch }}.deb - ./${{ github.event.repository.name }}-${{ steps.release-version.outputs.RELEASE_VERSION_RPM }}-1.${{ matrix.rpm_arch }}.rpm + ${{ github.event.repository.name }}_${{ steps.release-version.outputs.RELEASE_VERSION }}_${{ matrix.arch }}.deb + ${{ github.event.repository.name }}-${{ steps.release-version.outputs.RELEASE_VERSION_RPM }}-1.${{ matrix.rpm_arch }}.rpm # }} From c7a8bf79a9610b4a458bee5d1510c3e1fcf47bf8 Mon Sep 17 00:00:00 2001 From: Kirill Shklyaev Date: Thu, 12 Sep 2024 18:20:12 +0300 Subject: [PATCH 2/2] fix default value for mongo.spaces in coordinator conf --- any-sync-network/cmd/create.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/any-sync-network/cmd/create.go b/any-sync-network/cmd/create.go index 2fa0e50..3e24629 100644 --- a/any-sync-network/cmd/create.go +++ b/any-sync-network/cmd/create.go @@ -753,7 +753,7 @@ func defaultCoordinatorNode() CoordinatorNodeConfig { Spaces string "yaml:\"spaces\"" }{ Log: "log", - Spaces: "space", + Spaces: "spaces", }, SpaceStatus: struct { RunSeconds int "yaml:\"runSeconds\""