| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- on:
- workflow_run:
- workflows: ["Deploy Porter to Internal Tooling"]
- branches: [master]
- types:
- - completed
- name: Release dev cli and run integration tests
- jobs:
- build-linux:
- name: Build Linux binaries
- runs-on: ubuntu-latest
- if: ${{ github.event.workflow_run.conclusion == 'success' }}
- steps:
- - name: Checkout code
- uses: actions/checkout@v3
- - name: Set up Go
- uses: actions/setup-go@v4
- with:
- cache: false
- go-version: '1.20.5'
- go-version-file: go.mod
- - name: Build Linux binaries
- run: |
- go build -ldflags="-w -s -X 'github.com/porter-dev/porter/cli/cmd/config.Version=dev_${{ github.sha }}' -X 'github.com/porter-dev/porter/cli/cmd/errors.SentryDSN=${{secrets.SENTRY_DSN}}'" -a -tags cli -o ./porter ./cli &
- wait
- env:
- GOOS: linux
- GOARCH: amd64
- CGO_ENABLED: 0
- - name: Zip Linux binaries
- run: |
- mkdir -p ./release/linux
- zip --junk-paths ./release/linux/porter_dev_${{ github.sha }}_Linux_x86_64.zip ./porter
- - name: Upload binaries
- uses: actions/upload-artifact@v3
- with:
- path: ./release/linux
- name: linux-binaries
- retention-days: 1
- release:
- name: Zip binaries, create release and upload assets
- runs-on: ubuntu-latest
- needs:
- - build-linux
- steps:
- - name: Download binaries
- uses: actions/download-artifact@v3
- with:
- name: linux-binaries
- path: release/linux
- - name: Create Release
- id: create_release
- uses: softprops/action-gh-release@v1
- with:
- tag_name: dev_${{ github.sha }}
- name: Release dev cli for ${{ github.sha }}
- token: ${{ secrets.GITHUB_TOKEN }}
- draft: false
- prerelease: true
- - name: Upload Linux CLI Release Asset
- id: upload-linux-cli-release-asset
- uses: actions/upload-release-asset@v1
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- GITHUB_TAG: dev_${{ github.sha }}
- with:
- upload_url: ${{ steps.create_release.outputs.upload_url }}
- asset_path: ./release/linux/porter_dev_${{ github.sha }}_Linux_x86_64.zip
- asset_name: porter_dev_${{ github.sha }}_Linux_x86_64.zip
- asset_content_type: application/zip
- build-push-docker-cli:
- name: Build a new porter-cli docker image and push to dev tag
- runs-on: ubuntu-latest
- needs: release
- steps:
- - name: Checkout
- uses: actions/checkout@v3
- - name: Login to GHCR
- id: login-ghcr
- run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- - name: Build
- run: |
- docker build ./services/porter_cli_container \
- -t ghcr.io/porter-dev/porter/porter-cli:dev \
- -f ./services/porter_cli_container/Dockerfile \
- --build-arg VERSION=dev \
- --build-arg SENTRY_DSN=${{secrets.SENTRY_DSN}}
- - name: Push to GHCR
- run: |
- docker tag ghcr.io/porter-dev/porter/porter-cli:dev ghcr.io/porter-dev/porter/porter-cli:dev
- docker push ghcr.io/porter-dev/porter/porter-cli:dev
- run-integration-tests:
- name: run integration tests to test new build
- runs-on: ubuntu-latest
- needs: build-push-docker-cli
- steps:
- - name: Porter app run
- uses: porter-dev/porter-cli-action@v0.1.0
- with:
- command: app run app-integration-tests -- /app/trigger
- env:
- PORTER_CLUSTER: "142"
- PORTER_HOST: https://dashboard.internal-tools.porter.run
- PORTER_PROJECT: "301"
- PORTER_TOKEN: ${{ secrets.APP_INTEGRATION_PROJECT_TOKEN }}
- PORTER_SERVICE: porter
- PORTER_COMMIT: ${{ github.sha }}
|