This repository is currently being migrated. It's locked while the migration is in progress.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve the github actions and add codeowners (#232)
Separate the github actions into smaller steps for us to have an easier time to spot any issues and where these may have happened. Also have these run in parallel when possible. Add a CODEOWNERS file to the repo. These github actions should now look somewhat like the following image: 
- Loading branch information
1 parent
65ce350
commit 11f1c59
Showing
3 changed files
with
57 additions
and
22 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
* @storageos/controlsurface |
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 |
---|---|---|
@@ -1,41 +1,57 @@ | ||
name: Publish Release | ||
name: Build, test and Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
publish: | ||
cancel-previous: | ||
name: Cancel previous run | ||
runs-on: ubuntu-latest | ||
name: Publish Release | ||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- name: Checkout | ||
unit-tests: | ||
name: Run unit tests | ||
runs-on: ubuntu-latest | ||
needs: cancel-previous | ||
steps: | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.18 | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set Version Environment Variables | ||
run: | | ||
echo "VERSION_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | ||
# Remove leading v | ||
# Do parameter expansion outside of assignment | ||
version_tag=${GITHUB_REF#refs/tags/} | ||
semvar=${version_tag#v} | ||
echo "SEMANTIC_VERSION=$semvar" >> $GITHUB_ENV | ||
echo "version is $version_tag" | ||
echo "semvar is $semvar" | ||
- name: Run tests | ||
- name: Unit tests | ||
run: make test-docker | ||
|
||
- name: Build binaries | ||
build-binary: | ||
name: Build binary | ||
runs-on: ubuntu-latest | ||
needs: cancel-previous | ||
steps: | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.18 | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Build binary | ||
run: SEMANTIC_VERSION=${{ env.SEMANTIC_VERSION }} make release-docker | ||
|
||
- name: Create release | ||
github-release: | ||
name: Github Release | ||
runs-on: ubuntu-latest | ||
needs: [build-binary, unit-tests] | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
steps: | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
prerelease: true | ||
|
@@ -47,15 +63,33 @@ jobs: | |
./bin/release/storageos_windows_amd64 | ||
./bin/release/storageos_windows_amd64.sha256 | ||
dockerhub-release: | ||
name: DockerHub Release | ||
runs-on: ubuntu-latest | ||
needs: github-release | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
steps: | ||
- name: Set Version Environment Variables | ||
run: | | ||
echo "VERSION_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | ||
# Remove leading v | ||
# Do parameter expansion outside of assignment | ||
version_tag=${GITHUB_REF#refs/tags/} | ||
semvar=${version_tag#v} | ||
echo "SEMANTIC_VERSION=$semvar" >> $GITHUB_ENV | ||
echo "version is $version_tag" | ||
echo "semvar is $semvar" | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Login to container registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: docker.io | ||
username: ${{ secrets.DOCKERHUB_CLI_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_CLI_PASSWORD }} | ||
|
||
- name: Build image | ||
run: SEMANTIC_VERSION=${{ env.SEMANTIC_VERSION }} make build-cli-image | ||
|
||
- name: Push image | ||
run: SEMANTIC_VERSION=${{ env.SEMANTIC_VERSION }} make push-cli-image | ||
- name: Release github | ||
uses: softprops/action-gh-release@v1 |
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