diff --git a/.github/workflows/release-dockerhub.yml b/.github/workflows/release-dockerhub.yml deleted file mode 100644 index 8936960d..00000000 --- a/.github/workflows/release-dockerhub.yml +++ /dev/null @@ -1,51 +0,0 @@ -name: Release to DockerHub -on: - release: - types: [ published ] -jobs: - docker: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - images: | - mynaparrot/plugnmeet-server - tags: | - type=semver,pattern=v{{version}} - type=semver,pattern=v{{major}}.{{minor}} - - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version-file: "go.mod" - - - name: Download Go modules - run: go mod download - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - with: - image: tonistiigi/binfmt:latest - platforms: all - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to DockerHub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }} - - - name: Build and push - id: docker_build - uses: docker/build-push-action@v6 - with: - context: . - push: true - platforms: linux/amd64,linux/arm64 - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 00000000..4ff3f896 --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,73 @@ +name: Build server for release +on: + push: + branches: + - main + +permissions: + contents: write + pull-requests: write + +jobs: + release-server: + runs-on: ubuntu-latest + steps: + - uses: googleapis/release-please-action@v4 + id: release + with: + token: ${{ secrets.GITHUB_TOKEN }} + release-type: go + - name: Checkout + if: ${{ steps.release.outputs.release_created }} + uses: actions/checkout@v4 + - name: Setup go + if: ${{ steps.release.outputs.release_created }} + uses: actions/setup-go@v5 + with: + go-version-file: "go.mod" + - name: Download Go modules + if: ${{ steps.release.outputs.release_created }} + run: go mod download + - name: Upload server files + if: ${{ steps.release.outputs.release_created }} + run: make -j upload + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_RELEASE_UPLOAD_URL: ${{ steps.release.outputs.upload_url }} + - name: Docker meta + if: ${{ steps.release.outputs.release_created }} + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ secrets.DOCKERHUB_USERNAME }}/plugnmeet-server + tags: | + type=semver,pattern=${{ steps.release.outputs.tag_name }} + type=semver,pattern=v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} + + - name: Set up QEMU + if: ${{ steps.release.outputs.release_created }} + uses: docker/setup-qemu-action@v3 + with: + image: tonistiigi/binfmt:latest + platforms: all + + - name: Set up Docker Buildx + if: ${{ steps.release.outputs.release_created }} + uses: docker/setup-buildx-action@v3 + + - name: Login to DockerHub + if: ${{ steps.release.outputs.release_created }} + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }} + + - name: Build and push + if: ${{ steps.release.outputs.release_created }} + uses: docker/build-push-action@v6 + with: + context: . + push: true + platforms: linux/amd64,linux/arm64 + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/release-server.yml b/.github/workflows/release-server.yml deleted file mode 100644 index 489482a9..00000000 --- a/.github/workflows/release-server.yml +++ /dev/null @@ -1,16 +0,0 @@ -name: Build and release server -on: - release: - types: [ published ] -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 - with: - go-version-file: "go.mod" - - run: make -j upload - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITHUB_RELEASE_UPLOAD_URL: ${{ github.event.release.upload_url }}