diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index a2f542eea..9146d4389 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -6,42 +6,16 @@ on: - master jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - with: - fetch-depth: '0' - - name: Bump version and push tag - id: bump-version - uses: anothrNick/github-tag-action@1.17.2 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - WITH_V: true - DEFAULT_BUMP: patch - - name: Push Docker Image to Github Registry - uses: whoan/docker-build-with-cache-action@v5 - with: - username: "${{ github.actor }}" - password: "${{ secrets.GITHUB_TOKEN }}" - image_name: ${{ secrets.flytegithub_repo }}/flytecopilot - image_tag: latest,${{ github.sha }},${{ steps.bump-version.outputs.tag }} - push_git_tag: true - registry: docker.pkg.github.com - build_extra_args: "--compress=true" - bump-version: name: Bump Version if: github.event.commits[0].author.name != 'goreleaserbot' runs-on: ubuntu-latest - # Only to ensure it can successfully build - needs: build-docker outputs: version: ${{ steps.bump-version.outputs.tag }} steps: - uses: actions/checkout@v2 with: - fetch-depth: '0' + fetch-depth: "0" - name: Bump version and push tag id: bump-version uses: anothrNick/github-tag-action@1.17.2 @@ -50,13 +24,51 @@ jobs: WITH_V: true DEFAULT_BUMP: patch + goreleaser: + name: Goreleaser + runs-on: ubuntu-latest + needs: [bump-version] + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: "0" + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: 1.14 + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + version: latest + args: release --rm-dist + env: + GITHUB_TOKEN: ${{ secrets.FLYTE_BOT_PAT }} + + build: + runs-on: ubuntu-latest + needs: bump-version + steps: + - uses: actions/checkout@master + with: + fetch-depth: "0" + - name: Push Docker Image to Github Registry + uses: whoan/docker-build-with-cache-action@v5 + with: + username: "${{ secrets.FLYTE_BOT_USERNAME }}" + password: "${{ secrets.FLYTE_BOT_PAT }}" + image_name: ${{ github.repository_owner }}/flytecopilot + image_tag: latest,${{ github.sha }},${{ needs.bump-version.outputs.version }} + push_git_tag: true + registry: ghcr.io + build_extra_args: "--compress=true" + tests-lint: name: Run tests and lint runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 with: - fetch-depth: '0' + fetch-depth: "0" - name: Unit Tests uses: cedrickring/golang-action@1.5.2 env: diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index ad0bc32a1..47e01cd56 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -1,7 +1,6 @@ name: Pull Request -on: - pull_request +on: pull_request jobs: build-copilot: @@ -12,9 +11,9 @@ jobs: - name: Push Docker Image to Github Registry uses: whoan/docker-build-with-cache-action@v5 with: - username: "${{ secrets.PUBLISH_CONTAINER_ACTOR }}" - password: "${{ secrets.PUBLISH_CONTAINER }}" - image_name: ${{ github.repository }}/flytecopilot + username: "${{ secrets.FLYTE_BOT_USERNAME }}" + password: "${{ secrets.FLYTE_BOT_PAT }}" + image_name: ${{ github.repository_owner }}/flytecopilot image_tag: ${{ github.sha }} push_git_tag: true registry: ghcr.io @@ -41,4 +40,4 @@ jobs: env: GO111MODULE: "on" with: - args: make install && make lint \ No newline at end of file + args: make install && make lint diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 000000000..f3e4ddcec --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,9 @@ +project_name: flyteplugins +checksum: + name_template: "checksums.txt" +changelog: + sort: asc + filters: + exclude: + - "^docs:" + - "^test:"