From bf5423bd899aad854d5df45e1c4e344262abe982 Mon Sep 17 00:00:00 2001 From: Daniel Date: Wed, 19 Jun 2024 14:59:33 +0200 Subject: [PATCH] feat: refactor pipelines after kubernetes removal --- .github/workflows/continous-delivery.yml | 59 ---------------------- .github/workflows/continous-deployment.yml | 53 ------------------- .github/workflows/release-binaries.yaml | 53 +++++++++++++++++++ 3 files changed, 53 insertions(+), 112 deletions(-) delete mode 100644 .github/workflows/continous-delivery.yml delete mode 100644 .github/workflows/continous-deployment.yml create mode 100644 .github/workflows/release-binaries.yaml diff --git a/.github/workflows/continous-delivery.yml b/.github/workflows/continous-delivery.yml deleted file mode 100644 index 9e3f35f..0000000 --- a/.github/workflows/continous-delivery.yml +++ /dev/null @@ -1,59 +0,0 @@ -# FILE IS AUTOMATICALLY MANAGED BY github.com/vegaprotocol/terraform//github -name: "Continous Delivery Workflow" -"on": - workflow_call: - secrets: - DOCKERHUB_USERNAME: - required: true - DOCKERHUB_TOKEN: - required: true - -env: - GO_VERSION: "1.19.0" - -jobs: - release-docker: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Log in to the Container registry - uses: docker/login-action@v2 - if: ${{ !github.event.repository.private }} - with: - # registry: registry.hub.docker.com - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - - name: Log in to the Container registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - # private registry build - - name: Build and push - uses: docker/build-push-action@v3 - with: - context: . - push: true - tags: ghcr.io/${{ github.repository }}:latest,ghcr.io/${{ github.repository }}:${{ github.sha }},ghcr.io/${{ github.repository }}:${{ github.ref_name }} - - # public registry builds - - name: Build and push - uses: docker/build-push-action@v3 - if: ${{!github.event.repository.private}} - with: - context: . - push: true - tags: ${{ github.repository }}:latest,${{ github.repository }}:${{ github.sha }},${{ github.repository }}:${{ github.ref_name }} - - \ No newline at end of file diff --git a/.github/workflows/continous-deployment.yml b/.github/workflows/continous-deployment.yml deleted file mode 100644 index 9ff8e73..0000000 --- a/.github/workflows/continous-deployment.yml +++ /dev/null @@ -1,53 +0,0 @@ -# FILE IS AUTOMATICALLY MANAGED BY github.com/vegaprotocol/terraform//github -name: "Continous Deployment Workflow" -"on": - push: - branches: - - develop - - - master - -jobs: - integration: - uses: ./.github/workflows/continous-integration.yml - delivery: - needs: integration - uses: ./.github/workflows/continous-delivery.yml - secrets: - DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} - update-manifest-repo: - needs: delivery - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - uses: webfactory/ssh-agent@v0.5.4 - with: - ssh-private-key: ${{ secrets.VEGA_CI_SSH_KEY }} - - run: | - - version=${{ github.sha }} - - git config --global user.name 'vega-ci-bot' - git config --global user.email 'dev@vega.xyz' - git clone git@github.com:vegaprotocol/k8s.git - - if [ "$(git rev-parse --abbrev-ref HEAD)" = "develop" ]; then - echo -n "$version" > k8s/charts/apps/topgun-service/dev/VERSION - echo -n "$version" > k8s/charts/apps/topgun-service/dev2/VERSION - fi - - - if [ "$(git rev-parse --abbrev-ref HEAD)" = "master" ]; then - echo -n "$version" > k8s/charts/apps/topgun-service/prod/VERSION - fi - - ( - cd k8s - git add -A - git commit -m "Automated version update for topgun-service: $version, from repository: $GITHUB_REPOSITORY" - git pull --rebase - git push - ) diff --git a/.github/workflows/release-binaries.yaml b/.github/workflows/release-binaries.yaml new file mode 100644 index 0000000..3e826da --- /dev/null +++ b/.github/workflows/release-binaries.yaml @@ -0,0 +1,53 @@ +--- +name: Release topgun + +"on": + push: + tags: + - "v*" + +jobs: + release: + name: "Release for ${{ matrix.os }}-${{ matrix.arch }}" + runs-on: ubuntu-latest + permissions: + contents: write + strategy: + matrix: + arch: [amd64, arm64] + os: [linux, darwin] + env: + GOOS: ${{ matrix.os }} + GOARCH: ${{ matrix.arch }} + CGO_ENABLED: 0 + + steps: + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.20' + + - name: Check out code + uses: actions/checkout@v2 + with: + ref: ${{ inputs.tag }} + + - name: Build binary + run: go build -o dist/topgun-${{ matrix.os }}-${{ matrix.arch }} ./cmd/topgun-service/main.go + + - name: Bundle binary in archive + uses: thedoctor0/zip-release@master + with: + type: zip + directory: dist + filename: topgun-${{ matrix.os }}-${{ matrix.arch }}.zip + + - name: Release + uses: softprops/action-gh-release@v1 + with: + files: dist/*.zip + name: ${{ github.ref_name }} + tag_name: ${{ github.ref_name }} + prerelease: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}