This repository has been archived by the owner on Oct 16, 2024. It is now read-only.
Don't fail if no changes to commit #30
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: vendor-add-blob | |
on: | |
push: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
# TODO: add caching for cli downloads, see https://github.com/marketplace/actions/cache | |
- name: Install bosh-cli | |
#See https://github.com/marketplace/actions/install-a-binary-from-github-releases | |
uses: jaxxstorm/[email protected] | |
with: | |
repo: cloudfoundry/bosh-cli | |
tag: v7.4.0 | |
extension-matching: disable | |
chmod: 0755 | |
rename-to: bosh | |
# searching for bosh-cli-7.4.0-linux-amd64 with (linux|x86_64|x64|amd64).*(linux|x86_64|x64|amd64).*.(tar.gz|zip) | |
# bosh-cli-7.4.0-linux-amd64 | |
- name: Install vendir cli | |
#See https://github.com/marketplace/actions/install-a-binary-from-github-releases | |
uses: jaxxstorm/[email protected] | |
with: | |
repo: carvel-dev/vendir | |
tag: v0.34.6 | |
extension-matching: disable | |
chmod: 0755 | |
rename-to: vendir | |
- name: Install yq cli | |
#See https://github.com/marketplace/actions/install-a-binary-from-github-releases | |
uses: jaxxstorm/[email protected] | |
with: | |
repo: mikefarah/yq | |
tag: v4.34.2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # reduce potential rate limiting | |
- name: vendor-add-blob | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
AWS_BOSH_ACCES_KEY_ID: ${{ secrets.AWS_BOSH_ACCES_KEY_ID }} | |
AWS_BOSH_SECRET_ACCES_KEY: ${{ secrets.AWS_BOSH_SECRET_ACCES_KEY }} | |
run: | | |
set -x # enable traces | |
#pwd | |
#find . | |
# configure git | |
git config --global user.name "actions/k3s-boshrelease" | |
git config --global user.email "<>" | |
git config --global --add safe.directory /github/workspace | |
export VENDIR_GITHUB_API_TOKEN="${GITHUB_TOKEN}" | |
./vendor.sh | |
git add vendir.lock | |
# FIXME: optimize for idem potentency | |
./addblob.sh | |
remote_repo="https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@${GITHUB_SERVER_URL#https://}/${GITHUB_REPOSITORY}.git" | |
git add config/blobs.yml | |
! git commit -a -m "updating blobs" && \ | |
git push ${remote_repo} HEAD:master | |
- name: create bosh dev release | |
id: create-bosh-release | |
uses: orange-cloudfoundry/bosh-release-action@v2 # will create dev release when pushed git ref is not a tag | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
AWS_BOSH_ACCES_KEY_ID: ${{ secrets.AWS_BOSH_ACCES_KEY_ID }} | |
AWS_BOSH_SECRET_ACCES_KEY: ${{ secrets.AWS_BOSH_SECRET_ACCES_KEY }} | |
# See https://docs.github.com/en/actions/using-workflows/storing-workflow-data-as-artifacts | |
- name: Archive bosh dev release tgz | |
uses: actions/upload-artifact@v3 | |
with: | |
name: archive-bosh-dev-release-tgz | |
path: | | |
k3s-*.tgz |