chore: fix .releaserc #3
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
name: Create Release | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: read | |
jobs: | |
semantic-release: | |
permissions: | |
contents: write # for codfish/semantic-release-action to create release tags | |
runs-on: ubuntu-latest | |
outputs: | |
release-version: ${{ steps.semantic.outputs.new_release_version }} | |
new-release-published: ${{ steps.semantic.outputs.new-release-published }} | |
steps: | |
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0 | |
- uses: cycjimmy/semantic-release-action@61680d0e9b02ff86f5648ade99e01be17f0260a4 # v4.0.0 | |
id: semantic | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
docker: | |
needs: semantic-release | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@ee0669bd1cc54295c223e0bb666b733df41de1c5 # v2.7.0 | |
- name: Set version | |
# Always use git tags as semantic release can fail due to rate limit | |
run: | | |
git fetch --prune --unshallow | |
echo "RELEASE_VERSION=$(git describe --abbrev=0 --tags | sed -e 's/^v//')" >> $GITHUB_ENV | |
- name: Publish minimal image to registry | |
uses: elgohr/Publish-Docker-Github-Action@8217e91c0369a5342a4ef2d612de87492410a666 # master | |
with: | |
name: flanksource/canary-checker | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
snapshot: true | |
dockerfile: build/minimal/Dockerfile | |
tags: "latest,v${{ env.RELEASE_VERSION }}" | |
- name: Publish full image to registry | |
uses: elgohr/Publish-Docker-Github-Action@8217e91c0369a5342a4ef2d612de87492410a666 # master | |
with: | |
name: flanksource/canary-checker-full | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
snapshot: true | |
dockerfile: build/full/Dockerfile | |
tags: "latest,v${{ env.RELEASE_VERSION }}" | |
helm: | |
runs-on: ubuntu-latest | |
needs: [semantic-release, docker] | |
steps: | |
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | |
- name: Download yq | |
run: | | |
wget -nv -nc -O yq https://github.com/mikefarah/yq/releases/download/v4.20.2/yq_linux_amd64 | |
chmod +x yq | |
- name: Set version | |
# Always use git tags as semantic release can fail due to rate limit | |
run: | | |
git fetch --prune --unshallow | |
echo "RELEASE_VERSION=$(git describe --abbrev=0 --tags | sed -e 's/^v//')" >> $GITHUB_ENV | |
- name: Update chart version | |
run: ./yq -i e '.version = "${{ env.RELEASE_VERSION }}"' chart/Chart.yaml | |
- name: Update app version | |
run: ./yq -i e '.appVersion = "${{ env.RELEASE_VERSION }}"' chart/Chart.yaml | |
- name: Update image tags | |
run: ./yq -i e '.image.tag = "v${{ env.RELEASE_VERSION }}"' chart/values.yaml | |
- name: Set up Helm | |
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5 | |
with: | |
version: v3.8.0 | |
- name: Package Helm chart | |
run: | | |
make chart | |
- name: Clone charts repo | |
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | |
with: | |
repository: "${{ github.repository_owner }}/charts" | |
path: charts | |
token: "${{ secrets.FLANKBOT }}" | |
- name: Update chart repo | |
run: | | |
cd charts | |
cp ../canary-checker-*.tgz ./ | |
helm repo index --merge index.yaml . | |
- name: Push changes to chart repo | |
uses: stefanzweifel/git-auto-commit-action@8756aa072ef5b4a080af5dc8fef36c5d586e521d # v5.0.0 | |
with: | |
commit_message: "Release ${{ needs.semantic-release.outputs.release-version }} of ${{ github.repository }}" | |
branch: gh-pages | |
repository: ./charts | |
update-incident-commander-chart: | |
runs-on: ubuntu-latest | |
needs: [helm, semantic-release] | |
steps: | |
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | |
- name: Set version | |
# Always use git tags as semantic release can fail due to rate limit | |
run: | | |
git fetch --prune --unshallow | |
echo "RELEASE_VERSION=$(git describe --abbrev=0 --tags | sed -e 's/^v//')" >> $GITHUB_ENV | |
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | |
with: | |
repository: "${{ github.repository_owner }}/incident-commander-chart" | |
token: ${{ secrets.FLANKBOT }} | |
path: ./incident-commander-chart | |
- name: Install yq | |
run: | | |
wget https://github.com/mikefarah/yq/releases/download/${VERSION}/${BINARY}.tar.gz -O - |\ | |
tar xz && sudo mv ${BINARY} /usr/bin/yq | |
env: | |
VERSION: v4.25.1 | |
BINARY: yq_linux_amd64 | |
- name: Update canary-checker version in Incident-commander-chart | |
run: | | |
cd ./incident-commander-chart | |
yq eval-all -i '(.dependencies[] | select(.name == "canary-checker")) ref $d | $d.version = "${{ env.RELEASE_VERSION }}"' chart/Chart.yaml | |
- name: Push changes to chart repo | |
uses: stefanzweifel/git-auto-commit-action@8756aa072ef5b4a080af5dc8fef36c5d586e521d # v5.0.0 | |
with: | |
commit_message: "chore: update canary-checker chart dependency to ${{ env.RELEASE_VERSION }}" | |
repository: ./incident-commander-chart |