2021-12-21 00:58:37 +08:00
|
|
|
name: Build & publish images to the package registry for tags
|
|
|
|
|
|
|
|
on:
|
|
|
|
release:
|
|
|
|
types: [published]
|
2024-04-15 16:53:42 +08:00
|
|
|
workflow_run:
|
|
|
|
workflows: ["Build"]
|
2023-08-08 17:29:22 +08:00
|
|
|
branches: [livekit]
|
2024-04-15 16:53:42 +08:00
|
|
|
types:
|
|
|
|
- completed
|
2021-12-21 00:58:37 +08:00
|
|
|
|
|
|
|
env:
|
|
|
|
REGISTRY: ghcr.io
|
|
|
|
IMAGE_NAME: ${{ github.repository }}
|
|
|
|
|
|
|
|
jobs:
|
2024-04-15 16:53:42 +08:00
|
|
|
build_element_call:
|
2024-04-23 00:04:47 +08:00
|
|
|
if: ${{ github.event_name == 'release' }}
|
2024-04-15 16:53:42 +08:00
|
|
|
uses: ./.github/workflows/element-call.yaml
|
2024-04-15 22:47:07 +08:00
|
|
|
with:
|
2024-04-15 22:45:23 +08:00
|
|
|
vite_app_version: ${{ github.event.release.tag_name || github.sha }}
|
2024-04-15 16:53:42 +08:00
|
|
|
secrets:
|
|
|
|
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
|
|
|
|
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
|
|
|
|
SENTRY_URL: ${{ secrets.SENTRY_URL }}
|
|
|
|
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
|
|
|
publish_tarball:
|
2024-04-23 00:04:47 +08:00
|
|
|
needs: build_element_call
|
|
|
|
if: always()
|
2024-04-15 16:53:42 +08:00
|
|
|
name: Publish tarball
|
2021-12-21 00:58:37 +08:00
|
|
|
runs-on: ubuntu-latest
|
2024-04-15 16:53:42 +08:00
|
|
|
outputs:
|
|
|
|
unix_time: ${{steps.current-time.outputs.unix_time}}
|
2021-12-21 00:58:37 +08:00
|
|
|
permissions:
|
2023-01-03 18:48:48 +08:00
|
|
|
contents: write # required to upload release asset
|
2021-12-21 00:58:37 +08:00
|
|
|
packages: write
|
|
|
|
steps:
|
2023-08-09 22:45:56 +08:00
|
|
|
- name: Get current time
|
|
|
|
id: current-time
|
|
|
|
run: echo "unix_time=$(date +'%s')" >> $GITHUB_OUTPUT
|
2024-04-15 16:53:42 +08:00
|
|
|
- name: 📥 Download artifact
|
2024-08-01 09:04:00 +08:00
|
|
|
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4
|
2023-01-03 18:48:48 +08:00
|
|
|
with:
|
2024-04-15 16:53:42 +08:00
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
2024-04-23 00:39:19 +08:00
|
|
|
run-id: ${{ github.event.workflow_run.id || github.run_id }}
|
2024-04-15 16:53:42 +08:00
|
|
|
name: build-output
|
|
|
|
path: dist
|
2023-01-03 18:48:48 +08:00
|
|
|
- name: Create Tarball
|
|
|
|
env:
|
2023-08-08 18:59:06 +08:00
|
|
|
TARBALL_VERSION: ${{ github.event.release.tag_name || github.sha }}
|
2023-01-03 18:48:48 +08:00
|
|
|
run: |
|
2023-08-08 18:51:21 +08:00
|
|
|
tar --numeric-owner --transform "s/dist/element-call-${TARBALL_VERSION}/" -cvzf element-call-${TARBALL_VERSION}.tar.gz dist
|
2023-01-03 18:48:48 +08:00
|
|
|
- name: Upload
|
2024-10-09 18:02:22 +08:00
|
|
|
uses: actions/upload-artifact@84480863f228bb9747b473957fcc9e309aa96097 # v4.4.2
|
2023-01-03 18:48:48 +08:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
|
|
with:
|
2023-08-08 21:14:12 +08:00
|
|
|
path: "./element-call-*.tar.gz"
|
2024-04-15 16:53:42 +08:00
|
|
|
publish_docker:
|
|
|
|
needs: publish_tarball
|
2024-04-23 21:53:22 +08:00
|
|
|
if: always()
|
2024-04-17 21:29:57 +08:00
|
|
|
permissions:
|
|
|
|
contents: write
|
|
|
|
packages: write
|
2024-04-15 16:53:42 +08:00
|
|
|
uses: ./.github/workflows/docker.yaml
|
|
|
|
with:
|
2024-04-23 22:46:26 +08:00
|
|
|
artifact_run_id: ${{ github.event.workflow_run.id || github.run_id }}
|
2024-04-15 16:53:42 +08:00
|
|
|
docker_tags: |
|
|
|
|
type=sha,format=short,event=branch
|
|
|
|
type=semver,pattern=v{{version}}
|
|
|
|
type=raw,value=latest-ci,enable={{is_default_branch}}
|
|
|
|
type=raw,value=latest-ci_${{needs.publish_tarball.outputs.unix_time}},enable={{is_default_branch}}
|