fix(display-rules): separate citation queries for virtual properties … #289
This file contains hidden or 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: Release | |
| on: | |
| push: | |
| branches: [main] | |
| jobs: | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| # Only run if commit message contains the keyword [release] | |
| if: contains(github.event.head_commit.message, '[release]') | |
| permissions: | |
| contents: write | |
| issues: write | |
| pull-requests: write | |
| packages: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.10" | |
| - name: Setup Poetry | |
| uses: snok/install-poetry@v1 | |
| with: | |
| virtualenvs-create: true | |
| virtualenvs-in-project: true | |
| - name: Install dependencies | |
| run: poetry install | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "lts/*" | |
| - name: Install semantic-release | |
| run: | | |
| npm install -g semantic-release | |
| npm install -g @semantic-release/git | |
| npm install -g @semantic-release/changelog | |
| npm install -g @semantic-release/exec | |
| - name: Create Release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: npx semantic-release | |
| - name: Get latest version tag | |
| id: version | |
| run: | | |
| VERSION=$(git describe --tags --abbrev=0 2>/dev/null || echo "latest") | |
| # Remove 'v' prefix for Docker image tagging | |
| VERSION_CLEAN=${VERSION#v} | |
| echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT | |
| echo "VERSION_CLEAN=${VERSION_CLEAN}" >> $GITHUB_OUTPUT | |
| echo "Latest version: ${VERSION} (clean: ${VERSION_CLEAN})" | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
| password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract metadata | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: | | |
| ${{ secrets.DOCKER_HUB_USERNAME }}/heritrace | |
| ghcr.io/${{ github.repository }} | |
| tags: | | |
| type=raw,value=${{ steps.version.outputs.VERSION_CLEAN }},enable=${{ steps.version.outputs.VERSION != 'latest' }} | |
| type=raw,value=latest,enable={{is_default_branch}} | |
| flavor: | | |
| latest=false | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: ./Dockerfile | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| build-args: | | |
| DOCKER_METADATA_AUTHOR=Arcangelo Massari | |
| DOCKER_METADATA_DESCRIPTION=HERITRACE - Heritage Enhanced Repository Interface for Tracing, Research, Archival Curation, and Engagement. A semantic data editor for galleries, libraries, archives, and museums (GLAM) professionals. | |
| DOCKER_METADATA_VERSION=${{ github.ref_name }} | |
| - name: Update docker-compose.yml with latest version | |
| run: | | |
| # Extract the latest version tag from semantic-release output | |
| VERSION=$(git describe --tags --abbrev=0) | |
| # Remove 'v' prefix for Docker image tagging | |
| VERSION_CLEAN=${VERSION#v} | |
| # Update docker-compose.yml with the new version | |
| sed -i "s|image: ${{ secrets.DOCKER_HUB_USERNAME }}/heritrace:.*|image: ${{ secrets.DOCKER_HUB_USERNAME }}/heritrace:${VERSION_CLEAN}|g" docker-compose.yml | |
| - name: Commit updated docker-compose file | |
| run: | | |
| git config --local user.email "[email protected]" | |
| git config --local user.name "GitHub Action" | |
| git add docker-compose.yml | |
| if git diff --staged --quiet; then | |
| echo "No changes to commit" | |
| else | |
| git commit -m "ci: update docker-compose.yml with latest release version" | |
| git push | |
| fi |