Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
Update CI after migration (#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
EngHabu authored Feb 3, 2021
1 parent ae585ad commit e7201cf
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 34 deletions.
68 changes: 40 additions & 28 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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/[email protected]
Expand All @@ -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/[email protected]
env:
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Pull Request

on:
pull_request
on: pull_request

jobs:
build-copilot:
Expand All @@ -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
Expand All @@ -41,4 +40,4 @@ jobs:
env:
GO111MODULE: "on"
with:
args: make install && make lint
args: make install && make lint
9 changes: 9 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
project_name: flyteplugins
checksum:
name_template: "checksums.txt"
changelog:
sort: asc
filters:
exclude:
- "^docs:"
- "^test:"

0 comments on commit e7201cf

Please sign in to comment.