Skip to content

Release 0.40.2

Release 0.40.2 #55

Workflow file for this run

name: Release
run-name: Release ${{ github.event.release.tag_name }}
on:
release:
types: [created]
jobs:
version-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Verify release tag matches code version
run: |
expected="${{ github.event.release.tag_name }}"
actual=$(grep '^version' pyproject.toml | sed 's/.*"\(.*\)"/\1/')
if [ "$expected" != "$actual" ]; then
echo "::error::Release tag ($expected) does not match pyproject.toml version ($actual). Run 'just set-version $expected' and commit first."
exit 1
fi
test:
needs: version-check
uses: ./.github/workflows/test.yml
with:
full: true
build:
runs-on: ubuntu-latest
container: ghcr.io/freeshardbase/cicd-image:1.0.3
needs: test
permissions:
packages: write
steps:
- name: Inject enhanced GitHub environment variables
uses: rlespinasse/github-slug-action@v5
- uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ghcr.io/freeshardbase/freeshard:${{ github.event.release.tag_name }}
# pages:
# runs-on: ubuntu-latest
# needs:
# - build
# services:
# shard_core:
# image: ghcr.io/freeshardbase/freeshard:${{ github.event.release.tag_name }}
# ports:
# - 8000:8000
# steps:
# - name: Set up Node.js
# uses: actions/setup-node@v3
# with:
# node-version: '16'
# - name: Generate API Documentation
# run: npx @redocly/cli build-docs -o public/index.html http://localhost:8000/openapi.json
# - name: Deploy to GitHub Pages
# uses: peaceiris/actions-gh-pages@v3
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: ./public
#
# json-schema:
# runs-on: ubuntu-latest
# needs: build
# container: ghcr.io/freeshardbase/cicd-image:1.0.3
# steps:
# - uses: actions/checkout@v3
# - name: Set up Python
# uses: actions/setup-python@v4
# with:
# python-version: '3.11'
# - name: Install dependencies
# run: |
# python -m venv venv
# source venv/bin/activate
# pip install ".[dev]"
# - name: Generate JSON Schema
# run: |
# source venv/bin/activate
# python -m shard_core.model.app_meta
# - run: az storage blob upload-batch --destination "json-schema/$CI_COMMIT_REF_SLUG" --source schemas --sas-token $AZ_STORAGE_SAS_TOKEN --account-name storageaccountportab0da --overwrite