diff --git a/.gitea/workflows/build-develop.yaml b/.gitea/workflows/build-develop.yaml new file mode 100644 index 0000000..137fbf7 --- /dev/null +++ b/.gitea/workflows/build-develop.yaml @@ -0,0 +1,52 @@ +name: Build Develop Image +on: + push: + branches: + - 'develop' + +env: + FULL_TAG: git.mrmeeb.stream/mrmeeb/pywebfinger:develop + +jobs: + "Build Image": + runs-on: [ubuntu-docker-latest, linux/amd64] + steps: + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to Gitea Container Registry + uses: docker/login-action@v3 + with: + registry: git.mrmeeb.stream + username: ${{ env.GITHUB_ACTOR }} + password: ${{ secrets.GTCR_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v5 + with: + push: true + platforms: linux/amd64,linux/arm64 + tags: ${{ env.FULL_TAG }} + provenance: false + - name: Notify on failure + uses: rjstone/discord-webhook-notify@v1 + if: failure() + with: + severity: error + details: Build failed! + webhookUrl: ${{ secrets.DISCORD_WEBHOOK }} + username: Gitea + avatarUrl: ${{ vars.RUNNER_ICON_URL }} + "Notify": + runs-on: [ubuntu-docker-latest, linux/amd64] + needs: ["Build Image"] + steps: + - name: Notify of success + uses: rjstone/discord-webhook-notify@v1 + if: success() + with: + severity: info + details: Build succeeded! + webhookUrl: ${{ secrets.DISCORD_WEBHOOK }} + username: Gitea + avatarUrl: ${{ vars.RUNNER_ICON_URL }} \ No newline at end of file diff --git a/.gitea/workflows/build-main.yaml b/.gitea/workflows/build-main.yaml new file mode 100644 index 0000000..05c38e7 --- /dev/null +++ b/.gitea/workflows/build-main.yaml @@ -0,0 +1,52 @@ +name: Build Main Image +on: + push: + branches: + - 'main' + +env: + FULL_TAG: git.mrmeeb.stream/mrmeeb/pywebfinger:latest + +jobs: + "Build Image": + runs-on: [ubuntu-docker-latest, linux/amd64] + steps: + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to Gitea Container Registry + uses: docker/login-action@v3 + with: + registry: git.mrmeeb.stream + username: ${{ env.GITHUB_ACTOR }} + password: ${{ secrets.GTCR_TOKEN }} + - name: Build and push + uses: docker/build-push-action@v5 + with: + push: true + platforms: linux/amd64,linux/arm64 + tags: ${{ env.FULL_TAG }} + provenance: false + - name: Notify on failure + uses: rjstone/discord-webhook-notify@v1 + if: failure() + with: + severity: error + details: Build failed! + webhookUrl: ${{ secrets.DISCORD_WEBHOOK }} + username: Gitea + avatarUrl: ${{ vars.RUNNER_ICON_URL }} + "Notify": + runs-on: [ubuntu-docker-latest, linux/amd64] + needs: ["Build Image"] + steps: + - name: Notify of success + uses: rjstone/discord-webhook-notify@v1 + if: success() + with: + severity: info + details: Build succeeded! + webhookUrl: ${{ secrets.DISCORD_WEBHOOK }} + username: Gitea + avatarUrl: ${{ vars.RUNNER_ICON_URL }} \ No newline at end of file diff --git a/.gitea/workflows/build-tagged-release.yaml b/.gitea/workflows/build-tagged-release.yaml new file mode 100644 index 0000000..8814e0c --- /dev/null +++ b/.gitea/workflows/build-tagged-release.yaml @@ -0,0 +1,77 @@ +name: Build Tagged Release Image +on: + push: + tags: + - '*' + +env: + FULL_TAG: git.mrmeeb.stream/mrmeeb/pywebfinger + +jobs: + "Build Image": + runs-on: [ubuntu-docker-latest, linux/amd64] + steps: + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to Gitea Container Registry + uses: docker/login-action@v3 + with: + registry: git.mrmeeb.stream + username: ${{ env.GITHUB_ACTOR }} + password: ${{ secrets.GTCR_TOKEN }} + - name: Docker metadata + id: meta + uses: docker/metadata-action@v5 + with: + images: ${FULL_TAG} + tags: | + type=pep440,pattern={{version}} + - name: Build and push + uses: docker/build-push-action@v5 + with: + push: true + platforms: linux/amd64,linux/arm64 + tags: ${{ steps.meta.outputs.tags }} + provenance: false + - name: Notify on failure + uses: rjstone/discord-webhook-notify@v1 + if: failure() + with: + severity: error + details: Build failed! + webhookUrl: ${{ secrets.DISCORD_WEBHOOK }} + username: Gitea + avatarUrl: ${{ vars.RUNNER_ICON_URL }} + "Create Release": + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Go + uses: actions/setup-go@v4 + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v5 + with: + distribution: goreleaser + version: latest + args: release --clean -f .goreleaser-gitea.yaml + env: + GITHUB_TOKEN: ${{ secrets.GITEA_TOKEN }} + + "Notify": + runs-on: [ubuntu-docker-latest, linux/amd64] + needs: ["Build Image"] + steps: + - name: Notify of success + uses: rjstone/discord-webhook-notify@v1 + if: success() + with: + severity: info + details: Build succeeded! + webhookUrl: ${{ secrets.DISCORD_WEBHOOK }} + username: Gitea + avatarUrl: ${{ vars.RUNNER_ICON_URL }} \ No newline at end of file diff --git a/.gitea/workflows/test-pr.yaml b/.gitea/workflows/test-pr.yaml new file mode 100644 index 0000000..93b5cfa --- /dev/null +++ b/.gitea/workflows/test-pr.yaml @@ -0,0 +1,46 @@ +name: Test Pull Request +on: + pull_request: + branches: + - 'develop' + +env: + FULL_TAG: git.mrmeeb.stream/mrmeeb/pywebfinger:develop + +jobs: + "Build Image": + runs-on: [ubuntu-docker-latest, linux/amd64] + steps: + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Build + uses: docker/build-push-action@v5 + with: + push: false + platforms: linux/amd64,linux/arm64 + tags: ${{ env.FULL_TAG }} + provenance: false + - name: Notify on failure + uses: rjstone/discord-webhook-notify@v1 + if: failure() + with: + severity: error + details: Build failed! + webhookUrl: ${{ secrets.DISCORD_WEBHOOK }} + username: Gitea + avatarUrl: ${{ vars.RUNNER_ICON_URL }} + "Notify": + runs-on: [ubuntu-docker-latest, linux/amd64] + needs: ["Build Image"] + steps: + - name: Notify of success + uses: rjstone/discord-webhook-notify@v1 + if: success() + with: + severity: info + details: Build succeeded! + webhookUrl: ${{ secrets.DISCORD_WEBHOOK }} + username: Gitea + avatarUrl: ${{ vars.RUNNER_ICON_URL }} \ No newline at end of file