From 2733d82aa6146e4dad251081bac1c333daaa8f7c Mon Sep 17 00:00:00 2001 From: Grigory Efimov Date: Thu, 27 Nov 2025 13:44:25 -0300 Subject: [PATCH] .github/workflows/release.yml migrated on anyproto/shared-actions/.github/workflows/release-go-daemons-reusable.yml --- .github/workflows/push-docker-image.yml | 15 -- .github/workflows/release.yml | 194 ++---------------------- 2 files changed, 9 insertions(+), 200 deletions(-) delete mode 100644 .github/workflows/push-docker-image.yml diff --git a/.github/workflows/push-docker-image.yml b/.github/workflows/push-docker-image.yml deleted file mode 100644 index a97c8f8..0000000 --- a/.github/workflows/push-docker-image.yml +++ /dev/null @@ -1,15 +0,0 @@ -on: - # release: - # types: [published] - - workflow_dispatch: - -name: push-docker-image-release - -jobs: - push-docker-image-release: - uses: anyproto/any-sync-node/.github/workflows/push-docker-image-reusable.yml@main - secrets: inherit # pass all secrets - with: - release: ${{ github.event.release.tag_name }} - dockerfile-cmd: echo ok diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 71e814d..0e74b23 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,192 +1,16 @@ +name: Release + on: push: - # Sequence of patterns matched against refs/tags tags: - - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 - -name: Build and release + - 'v*.*.*' permissions: write-all jobs: - build: - name: build release - runs-on: ubuntu-latest - strategy: - matrix: - arch: - - amd64 - - arm64 - os: - - linux - - windows - - darwin - go-version: - - '1.24' - include: - - arch: amd64 - rpm_arch: x86_64 - - arch: arm64 - rpm_arch: aarch64 - - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-go@v5 - with: - go-version: '${{ matrix.go-version }}' - check-latest: true - - # build {{ - - name: Install deps - run: make deps CGO_ENABLED=0 - - #- name: unit tests - # run: make test CGO_ENABLED=0 - - - name: Build - run: make build CGO_ENABLED=0 BUILD_GOOS=${{ matrix.os}} BUILD_GOARCH=${{ matrix.arch }} - # }} - - - 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 | 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 | Linux and Darwin - if: matrix.os != 'windows' - run: | - tar \ - --create \ - --gzip \ - --verbose \ - --exclude='.gitignore' \ - --file=${{ github.event.repository.name }}-${{ steps.release-version.outputs.RELEASE_VERSION }}.${{ matrix.os }}-${{ matrix.arch }}.tgz \ - --directory=bin/ \ - . - - name: Create package | Deb - if: matrix.os == 'linux' - uses: fb929/github-action-fpm@master - with: - fpm_opts: - --name ${{ github.event.repository.name }} - --version ${{ steps.release-version.outputs.RELEASE_VERSION }} - --architecture ${{ matrix.arch }} - --exclude '*/.gitignore' - --exclude '*/.git' - --input-type dir - --output-type deb - fpm_args: ./bin - - - name: Create package | Rpm - if: matrix.os == 'linux' - uses: fb929/github-action-fpm@master - with: - fpm_opts: - --name ${{ github.event.repository.name }} - --version ${{ steps.release-version.outputs.RELEASE_VERSION }} - --architecture ${{ matrix.rpm_arch }} - --exclude '*/.gitignore' - --exclude '*/.git' - --input-type dir - --output-type rpm - fpm_args: ./bin - # }} - - - name: Debug - run: | - ls -al ./ - - # upload-release-asset {{ - - name: Create release and upload asset zip - uses: softprops/action-gh-release@v2 - if: matrix.os == 'windows' - with: - name: Release ${{ github.ref_name }} - generate_release_notes: true - 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 - - - name: Create release and upload asset tgz - uses: softprops/action-gh-release@v2 - if: matrix.os != 'windows' - with: - name: Release ${{ github.ref_name }} - generate_release_notes: true - 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 - - - name: Create release and upload assets deb and rpm - uses: softprops/action-gh-release@v2 - if: matrix.os == 'linux' - with: - name: Release ${{ github.ref_name }} - generate_release_notes: true - 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 - # }} - - push-docker-image: - runs-on: ubuntu-latest - steps: - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Log in to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Log in to DockerHub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Get docker metadata - id: meta - uses: docker/metadata-action@v5 - with: - images: | - ghcr.io/${{ github.repository }} - docker.io/${{ github.repository }} - tags: | - type=ref,event=tag - flavor: | - latest=auto - - - name: Build and push image - uses: docker/build-push-action@v6 - with: - platforms: linux/amd64,linux/arm64 - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=Configuration tools for Any-Sync network + release-reusable: + uses: anyproto/shared-actions/.github/workflows/release-go-daemons-reusable.yml@OPS-860 + secrets: inherit # pass all secrets + with: + matrix-os: '["linux", "windows","darwin"]' + build-cmd: cp ./any-sync-network/defaultTemplate.yml ./bin/