Skip to content

Update tj-actions/changed-files action to v41 [SECURITY] #363

Update tj-actions/changed-files action to v41 [SECURITY]

Update tj-actions/changed-files action to v41 [SECURITY] #363

Workflow file for this run

name: Publish Release
on:
push:
branches:
- 'main'
tags:
- 'v*'
concurrency:
group: release-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
file-changes:
runs-on: ubuntu-latest
outputs:
any: ${{ steps.check.outputs.any_changed }}
docs: ${{ steps.docs.outputs.any_changed }}
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
fetch-depth: 0
- name: Get changed files
id: check
uses: tj-actions/changed-files@v41
with:
files: |
.github/workflows/release.yml
build.gradle.kts
gradle/*.versions.toml
gradle/kotlin-js-store/**
**/client/web/**
**/client/ui/**
**/client/core/**
**/client/data-models/**
**/server/**
Dockerfile
Dockerfile-local
- name: Get changed files
id: docs
uses: tj-actions/changed-files@v41
with:
files: |
.github/workflows/release.yml
docs/**/**/*.md
mkdocs.yml
publish-docs:
runs-on: ubuntu-latest
needs: [ file-changes ]
if: needs.file-changes.outputs.docs == 'true' || startsWith(github.ref, 'refs/tags/v')
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure Git user
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.8'
architecture: x64
cache: 'pip'
cache-dependency-path: 'docs/requirements.txt'
- name: Install Python dependencies
run: python3 -m pip install -r ./docs/requirements.txt
- name: Deploy with mike (release)
if: startsWith(github.ref, 'refs/tags/v')
run: |
VERSION=${GITHUB_REF_NAME#v} mike deploy --update-aliases --push ${{ github.ref_name }} latest
- name: Deploy with mike (snapshot)
if: startsWith(github.ref, 'refs/tags/v') == false
run: |
VERSION=1.0.0-SNAPSHOT mike deploy --update-aliases --push v1.0.0-SNAPSHOT dev-snapshot
build-and-push-server:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
needs: [ file-changes ]
if: needs.file-changes.outputs.any == 'true' || startsWith(github.ref, 'refs/tags/v')
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: 'recursive'
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
- name: Cache Build files
uses: actions/cache@v3
with:
path: |
~/.konan
~/.gradle
key: ${{ runner.os }}-${{ hashFiles('gradle.properties') }}-v2
- uses: gradle/gradle-build-action@v2
name: Build Server and Web Client
with:
arguments: |
:anystream-server:server-app:installShadowDist
:anystream-server:server-app:shadowDistZip
:anystream-server:server-app:shadowDistTar
- name: Container registry Log in
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest,enable=${{ startsWith(github.ref, 'refs/tags/v') }}
type=ref,event=branch,enable=${{ startsWith(github.ref, 'refs/tags/v') == false }}
type=semver,pattern={{version}},enable=${{ startsWith(github.ref, 'refs/tags/v') }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
file: Dockerfile-local
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Upload build to Github Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/v')
with:
token: ${{ secrets.GITHUB_TOKEN }}
prerelease: ${{ contains(github.ref, '-') }}
files: |
anystream-server/server-app/build/dist/js/productionExecutable/*.zip
anystream-server/server-app/build/dist/js/productionExecutable/*.tar