Skip to content

Merge pull request #97 from rucio/dependabot/github_actions/docker/lo… #28

Merge pull request #97 from rucio/dependabot/github_actions/docker/lo…

Merge pull request #97 from rucio/dependabot/github_actions/docker/lo… #28

name: Build and Publish Extension
on:
push:
tags: 'v*'
jobs:
Test:
uses: ./.github/workflows/test.yml
Build:
needs: [Test]
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- name: Custom Setup
uses: ./.github/actions/setup
- name: Build sdist
run: |
pip install build
python -m build --sdist
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip_existing: true
- name: Notify Mattermost of release
if: success()
run: |
set -e
http_status=$(curl -s -w "%{http_code}" -o /tmp/mm_response.txt -X POST -H 'Content-Type: application/json' -d '{
"text": "#### :rocket: *New Rucio Jupterlab release published!*\n\nVersion: ${{ github.event.release.tag_name }}\nRepository: https://github.com/${{ github.repository }}\n\nView on PyPI: https://pypi.org/project/rucio-jupyterlab/\nChangelog: ${{ github.event.release.html_url }}\n\n:tada: Thank you to all contributors!"
}' "${{ secrets.ESCAPE_MATTERMOST_WEBHOOK_URL }}")
if [ "$http_status" -lt 200 ] || [ "$http_status" -ge 300 ]; then
echo "Error: Failed to send notification to Mattermost. HTTP status: $http_status"
cat /tmp/mm_response.txt
else
echo "Notification sent successfully. HTTP status: $http_status"
fi
Build-docker:
needs: [Test]
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Set up Docker Buildx
uses: docker/[email protected]
- name: Log into the Docker Hub
id: login
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Extract metadata for the Docker image
id: metadata
uses: docker/[email protected]
with:
flavor: |
latest=true
tags: |
type=semver,pattern={{raw}}
images: rucio/jupyterlab
- name: Build and push the Docker image
uses: docker/[email protected]
id: docker_build
with:
context: .
file: ./docker/container/Dockerfile
push: true
tags: ${{ steps.metadata.outputs.tags }}
labels: |
org.opencontainers.image.created=(date +'%Y-%m-%dT%H:%M:%SZ')
org.opencontainers.image.url=https://github.com/rucio/jupyterlab-extension
org.opencontainers.image.title=rucio-jupyterlab
org.opencontainers.image.description=JupyterLab extension for Rucio
org.opencontainers.image.version=${{ steps.metadata.outputs.tags }}