Skip to content

Bump matrix-js-sdk from 33.1.0 to 34.2.0 #425

Bump matrix-js-sdk from 33.1.0 to 34.2.0

Bump matrix-js-sdk from 33.1.0 to 34.2.0 #425

Workflow file for this run

name: CI
on:
push:
paths:
- '**'
branches:
- '**'
tags:
- '*.*.*'
workflow_dispatch:
env:
ARTIFACT_NAME: Matrix-Bot
DOCKER_IMAGE_NAME: matrix-bot
DOCKER_REGISTRY_DOMAIN: ghcr.io
jobs:
build:
name: Build
runs-on: ubuntu-22.04
permissions:
contents: read
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: npm install
- name: Lint
run: npx eslint
- name: Build
run: npx tsc
- name: Upload build artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}
path: |
dist/
package.json
package-lock.json
example.env
docker:
name: Docker
runs-on: ubuntu-22.04
needs: build
permissions:
contents: read
packages: write
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
- name: Setup Docker
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64
- name: Login to GitHub Container Registry
if: ${{ github.event_name != 'pull_request' && !startsWith( github.ref_name, 'dependabot/' ) }}
uses: docker/login-action@v3
with:
registry: ${{ env.DOCKER_REGISTRY_DOMAIN }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Download build artifact
uses: actions/download-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}
path: artifact
- name: Create metadata for Docker image
id: metadata
uses: docker/metadata-action@v5
with:
images: ${{ env.DOCKER_REGISTRY_DOMAIN }}/${{ github.repository_owner }}/${{ env.DOCKER_IMAGE_NAME }}
flavor: latest=${{ github.ref_name == 'main' }}
tags: |
type=ref,event=pr
type=ref,event=branch
type=semver,pattern={{major}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}.{{minor}}.{{patch}}
labels: |
org.opencontainers.image.title=Matrix Bot
org.opencontainers.image.vendor=${{ github.repository_owner }}
com.docker.extension.publisher-url=https://viral32111.com
- name: Build & push Docker image
uses: docker/build-push-action@v6
with:
push: ${{ github.event_name != 'pull_request' && !startsWith( github.ref_name, 'dependabot/' ) }}
file: Dockerfile
context: artifact
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
platforms: linux/amd64
provenance: false
no-cache: true
pull: true
- name: Delete old Docker images
if: ${{ github.event_name != 'pull_request' && !startsWith( github.ref_name, 'dependabot/' ) }}
uses: snok/container-retention-policy@v2
with:
image-names: ${{ env.DOCKER_IMAGE_NAME }}
cut-off: 24 hours ago UTC
keep-at-least: 1
untagged-only: true
skip-tags: latest
account-type: personal
token: ${{ secrets.PERSONAL_ACCESS_TOKEN_PACKAGES }}
release:
name: Release
runs-on: ubuntu-22.04
needs: docker
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
permissions:
contents: write
steps:
- name: Clone repository
uses: actions/checkout@v4
- name: Download build artifact
uses: actions/download-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}
path: artifact
- name: Bundle build artifact
run: zip -r ${{ env.ARTIFACT_NAME }}.zip artifact
- name: Create draft release
uses: softprops/action-gh-release@v2
with:
draft: true
tag_name: ${{ github.ref_name }}
files: ${{ env.ARTIFACT_NAME }}.zip
token: ${{ secrets.GITHUB_TOKEN }}