Build & publish images to the package registry for releases #1322
This file contains 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: Build & publish images to the package registry for releases | |
on: | |
workflow_dispatch: | |
release: | |
types: [published] | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
build_element_call: | |
# if: ${{ github.event_name == 'release' }} | |
uses: ./.github/workflows/build-element-call.yaml | |
with: | |
vite_app_version: ${{ github.event.release.tag_name || github.sha }} | |
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: | |
needs: build_element_call | |
if: false | |
name: Publish tarball | |
runs-on: ubuntu-latest | |
outputs: | |
unix_time: ${{steps.current-time.outputs.unix_time}} | |
permissions: | |
contents: write # required to upload release asset | |
packages: write | |
steps: | |
- name: Get current time | |
id: current-time | |
run: echo "unix_time=$(date +'%s')" >> $GITHUB_OUTPUT | |
- name: 📥 Download artifact | |
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
run-id: ${{ github.event.workflow_run.id || github.run_id }} | |
name: build-output | |
path: dist | |
- name: Create Tarball | |
env: | |
TARBALL_VERSION: ${{ github.event.release.tag_name || github.sha }} | |
run: | | |
tar --numeric-owner --transform "s/dist/element-call-${TARBALL_VERSION}/" -cvzf element-call-${TARBALL_VERSION}.tar.gz dist | |
- name: Upload | |
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
with: | |
path: "./element-call-*.tar.gz" | |
publish_docker: | |
needs: publish_tarball | |
if: false | |
permissions: | |
contents: write | |
packages: write | |
uses: ./.github/workflows/build-and-publish-docker.yaml | |
with: | |
artifact_run_id: ${{ github.event.workflow_run.id || github.run_id }} | |
docker_tags: | | |
type=sha,format=short,event=branch | |
type=semver,pattern=v{{version}} | |
publish_android: | |
needs: build_element_call | |
if: always() | |
name: Publish Android AAR | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- name: 📥 Download artifact | |
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
run-id: ${{ github.event.workflow_run.id || github.run_id }} | |
name: build-output | |
path: dist | |
- name: Publish AAR to GH gradle registry | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: platforms/android/publish_android_package.sh -s | |