Skip to content

Commit

Permalink
Merge pull request fluxcd#15 from fluxcd/ci-release
Browse files Browse the repository at this point in the history
ci: Add release workflow
  • Loading branch information
stefanprodan authored Apr 13, 2020
2 parents f8e0685 + caedca3 commit 0e82a43
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: release
on:
push:
tags:
- 'v*'

jobs:
build-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Kustomize
uses: ./.github/actions/kustomize
- name: Generate release asset
run: |
mkdir -p config/release
cp config/default/* config/release
cd config/release
kustomize edit set image fluxcd/source-controller=fluxcd/source-controller:${{ github.ref }}
kustomize build . > source-controller.yaml
- name: Push image
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: fluxcd/source-controller
tag_with_ref: true
- name: Create release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: true
body: |
[CHANGELOG](https://github.com/fluxcd/source-controller/blob/master/CHANGELOG.md)
- name: Upload artifacts
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./config/release/source-controller.yaml
asset_name: source-controller.yaml
asset_content_type: text/plain
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
# Dependency directories (remove the comment below to include it)
# vendor/
bin/
config/release/

0 comments on commit 0e82a43

Please sign in to comment.