-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Adding automatic image building and release management (#69)
* feat: adds workflows for automatic releases * ci: cleanup * test: bumping up wait time to eliminate false failures * ci: update token * chore: testing release flow * chore: temporary test branch config * ci: set proper author/committer names * ci: set proper bot email addresses * ci: trying with empty email credentials * ci: another attempt to correctly identify the bot user * chore: undo testing hacks * fix: broken tests after minor/patch dependency upgrades * ci: update actions to also push to dockerhub * ci: push latest/SHA tags for master as well * ci: cleanup and making push jobs parallel
- Loading branch information
Showing
12 changed files
with
4,712 additions
and
1,678 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ insert_final_newline = true | |
[*.json] | ||
indent_size = 2 | ||
|
||
[*.yaml] | ||
[*.{yaml,yml}] | ||
indent_size = 2 | ||
|
||
[*.md] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Pull Request | ||
on: pull_request | ||
|
||
jobs: | ||
build_push_github: | ||
name: Build and push to Github | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- 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.package_name }} | ||
image_tag: ${{ github.sha }} | ||
registry: docker.pkg.github.com | ||
build_push_dockerhub: | ||
name: Build and push to Dockerhub | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Push Docker Image to Dockerhub | ||
uses: whoan/docker-build-with-cache-action@v5 | ||
with: | ||
username: "${{ secrets.DOCKERHUB_USERNAME }}" | ||
password: "${{ secrets.DOCKERHUB_PASSWORD }}" | ||
image_name: ${{ secrets.DOCKERHUB_IMAGE_NAME }} | ||
image_tag: ${{ github.sha }} | ||
build_extra_args: "--compress=true" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
jobs: | ||
release: | ||
name: Generate Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12 | ||
- name: Install dependencies | ||
run: yarn install --frozen-lockfile | ||
- name: Release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.RELEASEBOT_TOKEN }} | ||
GIT_AUTHOR_NAME: "service-github-lyft-semantic-release" | ||
GIT_AUTHOR_EMAIL: "[email protected]" | ||
GIT_COMMITTER_NAME: "service-github-lyft-semantic-release" | ||
GIT_COMMITTER_EMAIL: "[email protected]" | ||
run: npx semantic-release | ||
check_for_tag: | ||
name: Get Release Tag | ||
needs: release | ||
runs-on: ubuntu-latest | ||
outputs: | ||
currentTag: ${{ steps.setTag.outputs.currentTag }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
# Use the latest commit on the branch which triggered this workflow, | ||
# not the commit which triggered the workflow | ||
ref: ${{ github.ref }} | ||
- name: Fetch tags | ||
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* | ||
- name: Get target git ref | ||
id: setTag | ||
# Print any tags associated with the target ref, in reverse lexicographical | ||
# order so that the first item is the highest version number. If we find | ||
# a tag, update our target | ||
run: | | ||
CURRENT_TAG=$(git tag --sort=-refname --points-at ${{ github.ref }} | head -n 1) | ||
echo "::set-output name=currentTag::$CURRENT_TAG" | ||
build_push_github: | ||
name: Build and push image to Github | ||
needs: check_for_tag | ||
runs-on: ubuntu-latest | ||
if: needs.check_for_tag.outputs.currentTag | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ needs.check_for_tag.outputs.currentTag }} | ||
- 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.package_name }} | ||
image_tag: latest,${{github.sha}},${{ needs.check_for_tag.outputs.currentTag }} | ||
push_git_tag: true | ||
registry: docker.pkg.github.com | ||
push_dockerhub: | ||
name: Build and push image to Dockerhub | ||
needs: check_for_tag | ||
runs-on: ubuntu-latest | ||
if: needs.check_for_tag.outputs.currentTag | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ needs.check_for_tag.outputs.currentTag }} | ||
- name: Push Docker Image to Dockerhub | ||
uses: whoan/docker-build-with-cache-action@v5 | ||
with: | ||
username: "${{ secrets.DOCKERHUB_USERNAME }}" | ||
password: "${{ secrets.DOCKERHUB_PASSWORD }}" | ||
image_name: ${{ secrets.DOCKERHUB_IMAGE_NAME }} | ||
image_tag: latest,${{ github.sha }},${{ needs.check_for_tag.outputs.currentTag }} | ||
push_git_tag: true | ||
build_extra_args: "--compress=true" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"plugins": [ | ||
"@semantic-release/commit-analyzer", | ||
"@semantic-release/release-notes-generator", | ||
[ | ||
"@semantic-release/changelog", | ||
{ | ||
"changelogTitle": "# Changelog\n\nAll notable changes to this project will be documented in this file. See\n[Conventional Commits](https://conventionalcommits.org) for commit guidelines." | ||
} | ||
], | ||
["@semantic-release/npm", { "npmPublish": false }], | ||
"@semantic-release/github", | ||
[ | ||
"@semantic-release/git", | ||
{ | ||
"assets": ["package.json", "CHANGELOG.md"], | ||
"message": "chore(release): Release ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" | ||
} | ||
] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. See | ||
[Conventional Commits](https://conventionalcommits.org) for commit guidelines. | ||
|
||
# [0.6.0](http://github.com/lyft/flyteconsole/compare/v0.5.2...v0.6.0) (2020-05-13) | ||
|
||
|
||
### Bug Fixes | ||
|
||
* adds proper plugin to update package.json when releasing ([8640ac7](http://github.com/lyft/flyteconsole/commit/8640ac7f8e9620aa1484c30d24c50fe7862021ad)) | ||
|
||
|
||
### Features | ||
|
||
* testing publishing of a release ([3c77418](http://github.com/lyft/flyteconsole/commit/3c774183c897a17c29481eba65b93a358b62cc8e)) | ||
|
||
# [0.6.0](http://github.com/lyft/flyteconsole/compare/v0.5.2...v0.6.0) (2020-05-13) | ||
|
||
|
||
### Bug Fixes | ||
|
||
* adds proper plugin to update package.json when releasing ([8640ac7](http://github.com/lyft/flyteconsole/commit/8640ac7f8e9620aa1484c30d24c50fe7862021ad)) | ||
|
||
|
||
### Features | ||
|
||
* testing publishing of a release ([3c77418](http://github.com/lyft/flyteconsole/commit/3c774183c897a17c29481eba65b93a358b62cc8e)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = { extends: ['@commitlint/config-conventional'] }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.