Skip to content

Commit

Permalink
ci: harmonize release with workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
alexec committed May 12, 2021
1 parent 8eaf82d commit 126dfc9
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 46 deletions.
46 changes: 0 additions & 46 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: Build

on:
push:
tags: [ v* ]
branches: [ main ]
pull_request:
branches: [ main ]
Expand Down Expand Up @@ -61,48 +60,3 @@ jobs:
- name: controller logs
if: ${{ failure() }}
run: kubectl -n argo-dataflow-system logs deploy/controller-manager -c manager

publish-images:
runs-on: ubuntu-latest
needs: [ test, lint ]
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
strategy:
matrix:
target: [ controller, runner, go1-16, java16, python3-9 ]
steps:
- uses: actions/checkout@v2
- uses: docker/setup-qemu-action@v1
- uses: docker/setup-buildx-action@v1
- uses: docker/login-action@v1
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_ROBOT_TOKEN }}
- name: docker build + push
run: |
tag=$(basename $GITHUB_REF)
if [ $tag = "main" ]; then
tag="latest"
fi
docker buildx build . --target ${{matrix.target}} --tag quay.io/argoproj/dataflow-${{matrix.target}}:$tag --push
publish-release:
runs-on: ubuntu-latest
needs: [ publish-images ]
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.16
- run: make manifests changelog TAG=${GITHUB_REF##*/}
- name: Publish release
uses: softprops/action-gh-release@v1
with:
prerelease: ${{ startsWith(github.ref, 'refs/tags/v0') || contains(github.ref, 'rc') }}
body_path: changelog
files: |
config/default.yaml
config/quick-start.yaml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Release

on:
push:
tags: [ v* ]
branches: [ main ]

jobs:

publish-images:
runs-on: ubuntu-latest
strategy:
matrix:
target: [ controller, runner, go1-16, java16, python3-9 ]
steps:
- uses: actions/checkout@v2
- uses: docker/setup-qemu-action@v1
- uses: docker/setup-buildx-action@v1
- uses: docker/login-action@v1
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_ROBOT_TOKEN }}
- name: docker build + push
run: |
tag=$(basename $GITHUB_REF)
if [ $tag = "main" ]; then
tag="latest"
fi
docker buildx build . --target ${{matrix.target}} --tag quay.io/argoproj/dataflow-${{matrix.target}}:$tag --push
publish-release:
runs-on: ubuntu-latest
needs: [ publish-images ]
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.16
- run: make manifests changelog TAG=${GITHUB_REF##*/}
- name: Publish release
uses: softprops/action-gh-release@v1
with:
prerelease: ${{ startsWith(github.ref, 'refs/tags/v0') || contains(github.ref, 'rc') }}
body_path: changelog
files: |
config/default.yaml
config/quick-start.yaml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 126dfc9

Please sign in to comment.