Skip to content

chore(build): try to automate release from GitHub #2

chore(build): try to automate release from GitHub

chore(build): try to automate release from GitHub #2

Workflow file for this run

name: create-dev-release
on:
push:
branches:
# See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
# *: Matches zero or more characters, but does not match the / character. For example, Octo* matches Octocat.
# **: Matches zero or more of any character.
- master
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 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
# TODO: optimize to only create a dev release if the blobs.yaml file has some changes
# Possibly by setting an env var and checking it into next step
# See https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-environment-variable
# and if clause https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsif
- name: create bosh dev release
id: create-bosh-release
uses: orange-cloudfoundry/[email protected] # will create dev release when pushed git ref is not a tag
with:
target_branch: ${{github.ref_name}}
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
# This creates a zip file containing the k3s-master.tgz file
# See https://github.com/actions/upload-artifact#zipped-artifact-downloads
# > There is currently no way to download artifacts after a workflow run finishes in a format other than a zip or
# > to download artifact contents individually. One of the consequences of this limitation is that if a zip is
# > uploaded during a workflow run and then downloaded from the UI, there will be a double zip created.
- name: Archive bosh dev release tgz
uses: actions/upload-artifact@v3
with:
name: archive-bosh-dev-release-tgz
path: |
generic-scripting-*.tgz
- name: Bump version and push tag
uses: anothrNick/[email protected] # Don't use @master or @v1 unless you're happy to test the latest version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # if you don't want to set write permissions use a PAT token
WITH_V: true
DEFAULT_BUMP: none
INITIAL_VERSION: 5.0.1