Skip to content

Release

Release #5

Workflow file for this run

name: Release
on:
release:
types: [published]
workflow_dispatch:
jobs:
run-tests:
uses: ./.github/workflows/tests.yml
secrets: inherit
check-version:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: s-weigand/[email protected]
- name: Install Sunbeam
shell: bash
run: |
cd $GITHUB_WORKSPACE
GIT_VERSION=$(bash install.sh -w)
echo "GIT_VERSION=$GIT_VERSION" >> $GITHUB_ENV
- name: Download and Extract
shell: bash
run: |
wget https://github.com/sunbeam-labs/sunbeam/releases/latest/download/sunbeam.tar.gz
mkdir tar_sunbeam
tar -zxf sunbeam.tar.gz -C tar_sunbeam
cd tar_sunbeam
TAR_VERSION=$(bash install.sh -w)
echo "TAR_VERSION=$TAR_VERSION" >> $GITHUB_ENV
- id: get_version
uses: battila7/get-version-action@v2
- name: Check version
run: |
GITHUB_VERSION=${{ steps.get_version.outputs.version-without-v }}
if [[ $LIBRARY_VERSION == ${{ env.GIT_VERSION }} ]] && [[ ${{ env.GIT_VERSION }} == ${{ env.TAR_VERSION }} ]]; then
echo "Versions match, continuing..."
else
echo "Versions don't match, exiting..."
echo "Library version: ${LIBRARY_VERSION}"
echo "GitHub version: ${{ env.GIT_VERSION }}"
echo "Tarball version: ${{ env.TAR_VERSION }}"
exit 1
fi
test-tarball:
name: Test Tarball
runs-on: ubuntu-latest
needs:
- run-tests
- check-version
steps:
- name: setup-conda
uses: s-weigand/[email protected]
- name: Download and Extract
shell: bash
run: |
wget https://github.com/sunbeam-labs/sunbeam/releases/latest/download/sunbeam.tar.gz
mkdir sunbeam
tar -zxf sunbeam.tar.gz -C sunbeam
cd sunbeam && ./install.sh -e sunbeam
- name: Run Tests
shell: bash
run: |
source activate sunbeam
cd sunbeam
pytest -vvl tests/
push-dockerhub:
name: Push to Dockerhub
runs-on: ubuntu-latest
needs:
- run-tests
- check-version
steps:
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ctbushman/sunbeam
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
run-integration-tests:
uses: ./.github/workflows/integration-tests.yml
secrets: inherit
needs:
- push-dockerhub
- test-tarball