change actions/cache@v4 to v3 #104
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 Dev Release | |
# Delete the previous development release and recreate it | |
# with code based off of the main branch. Also updates the | |
# DEV_RELEASE tag for the image to match. | |
# | |
# This is done so that the openshift-tools-installer has a valid | |
# semantic version release to install. | |
# https://github.com/redhat-actions/openshift-tools-installer | |
on: | |
push: | |
branches: | |
- main | |
env: | |
DEV_RELEASE: 0.1.0 | |
jobs: | |
release: | |
name: Create Dev Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version-file: go.mod | |
- name: Set up Python 3.x | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- name: Set up Python scripts | |
run: | | |
# set up python requirements and scripts on PR branch | |
python3 -m venv ve1 | |
cd scripts && ../ve1/bin/pip3 install -r requirements.txt && cd .. | |
cd scripts && ../ve1/bin/python3 setup.py install && cd .. | |
- name: Build Binary | |
id: build-binary | |
run: make bin | |
- name: Create tarfile | |
if: ${{ steps.build-binary.outcome == 'success' }} | |
id: create-tarfile | |
run: | | |
# check if release file only is included in PR | |
ve1/bin/tar-file --release=${DEV_RELEASE} | |
- name: Delete previous release and tag | |
id: delete-previous | |
if: ${{ steps.create-tarfile.outcome == 'success' }} | |
uses: dev-drprasad/[email protected] | |
with: | |
delete_release: true # default: false | |
tag_name: ${{ env.DEV_RELEASE }} # tag name to delete | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# The next step seems to periodically create a draft release. | |
# We think this is because of a race condition. | |
# Force a wait after the previous release was deleted. | |
- name: Sleep and to buffer release recreation | |
id: sleep-after-delete-previous | |
run: sleep 8 | |
- name: Create the release | |
id: create_release | |
if: ${{ steps.delete-previous.outcome == 'success' && steps.sleep-after-delete-previous.outcome == 'success' }} | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: ${{ env.DEV_RELEASE }} | |
body: "Development release created with each merge into the main branch." | |
files: ${{ steps.create-tarfile.outputs.tarball_full_name }} | |
prerelease: true | |
draft: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
image: | |
name: Create Dev Image | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version-file: go.mod | |
- name: Set up Python 3.x | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- name: Set up Python scripts | |
run: | | |
# set up python requirements and scripts on PR branch | |
python3 -m venv ve1 | |
cd scripts && ../ve1/bin/pip3 install -r requirements.txt && cd .. | |
cd scripts && ../ve1/bin/python3 setup.py install && cd .. | |
- name: Create image | |
id: build-image | |
run: ve1/bin/build-and-test --image-name="quay.io/redhat-certification/chart-verifier" --sha-value=$DEV_RELEASE --build-only="True"} | |
- name: Login to Registry | |
id: login-as-bot | |
uses: docker/login-action@v2 | |
if: ${{ steps.build-image.outcome == 'success'}} | |
with: | |
registry: quay.io | |
username: ${{ secrets.QUAY_BOT_USERNAME }} | |
password: ${{ secrets.QUAY_BOT_TOKEN }} | |
- name: Push Image | |
if: ${{ steps.login-as-bot.outcome == 'success' }} | |
run: | | |
docker push quay.io/redhat-certification/chart-verifier:$DEV_RELEASE |