mirror of
https://github.com/inventree/InvenTree.git
synced 2026-09-10 14:47:20 +00:00
Bumps the dependencies group with 5 updates: | Package | From | To | | --- | --- | --- | | [oasdiff/oasdiff-action/diff](https://github.com/oasdiff/oasdiff-action) | `0.1.13` | `0.1.14` | | [zizmorcore/zizmor-action](https://github.com/zizmorcore/zizmor-action) | `0.6.2` | `0.6.3` | | [anchore/sbom-action](https://github.com/anchore/sbom-action) | `0.24.0` | `0.24.2` | | [github/codeql-action/upload-sarif](https://github.com/github/codeql-action) | `4.37.8` | `4.37.9` | | [crowdin/github-action](https://github.com/crowdin/github-action) | `2.17.1` | `3.0.1` | Updates `oasdiff/oasdiff-action/diff` from 0.1.13 to 0.1.14 - [Release notes](https://github.com/oasdiff/oasdiff-action/releases) - [Commits](https://github.com/oasdiff/oasdiff-action/compare/2649ebe137aeb72a95707671204e829f86e091fc...54d7a752569cb30b644b7f27a362c1077973d1c0) Updates `zizmorcore/zizmor-action` from 0.6.2 to 0.6.3 - [Release notes](https://github.com/zizmorcore/zizmor-action/releases) - [Commits](https://github.com/zizmorcore/zizmor-action/compare/3dc1ecc9bcb9e94e9b2c709687979e1298497054...70fb788f84895a7701f5643d103d587e460b5c99) Updates `anchore/sbom-action` from 0.24.0 to 0.24.2 - [Release notes](https://github.com/anchore/sbom-action/releases) - [Changelog](https://github.com/anchore/sbom-action/blob/main/RELEASE.md) - [Commits](https://github.com/anchore/sbom-action/compare/e22c389904149dbc22b58101806040fa8d37a610...3ad7283483fc7af8ff2b4ea19663c2d5ca935e26) Updates `github/codeql-action/upload-sarif` from 4.37.8 to 4.37.9 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/db488ddef3bf6cb639b32c2e9a7c0a7ea8271d28...cdf488f595d80d6e07e03d4674febd5ab45fa938) Updates `crowdin/github-action` from 2.17.1 to 3.0.1 - [Release notes](https://github.com/crowdin/github-action/releases) - [Commits](https://github.com/crowdin/github-action/compare/8f01d54f70f1713ee3f09d82c2bbb2daeac28689...71fdb8814261dd703be4ca7c6450d21b1868da4b) --- updated-dependencies: - dependency-name: oasdiff/oasdiff-action/diff dependency-version: 0.1.14 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dependencies - dependency-name: zizmorcore/zizmor-action dependency-version: 0.6.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dependencies - dependency-name: anchore/sbom-action dependency-version: 0.24.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dependencies - dependency-name: github/codeql-action/upload-sarif dependency-version: 4.37.9 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dependencies - dependency-name: crowdin/github-action dependency-version: 3.0.1 dependency-type: direct:production update-type: version-update:semver-major dependency-group: dependencies ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
283 lines
11 KiB
YAML
283 lines
11 KiB
YAML
# Runs on releases
|
|
|
|
name: Publish release
|
|
on:
|
|
release:
|
|
types: [published]
|
|
permissions:
|
|
contents: read
|
|
env:
|
|
python_version: 3.12
|
|
|
|
jobs:
|
|
stable:
|
|
runs-on: ubuntu-24.04
|
|
name: Write release to stable branch
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
- name: Version Check
|
|
run: |
|
|
pip install --require-hashes -r contrib/dev_reqs/requirements.txt
|
|
python3 .github/scripts/version_check.py
|
|
- name: Push to Stable Branch
|
|
uses: ad-m/github-push-action@881a6320fdb16eb5318c5054f31c218aec2b324c # v1.3.0
|
|
if: env.stable_release == 'true'
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
branch: stable
|
|
force: true
|
|
|
|
build:
|
|
runs-on: ubuntu-24.04
|
|
name: Build and attest frontend
|
|
permissions:
|
|
id-token: write
|
|
contents: write
|
|
attestations: write
|
|
artifact-metadata: write
|
|
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
- name: Environment Setup
|
|
uses: ./.github/actions/setup
|
|
with:
|
|
npm: true
|
|
- name: Install dependencies
|
|
run: cd src/frontend && yarn install
|
|
- name: Build frontend
|
|
run: cd src/frontend && npm run compile && npm run build
|
|
- name: Create SBOM for frontend
|
|
uses: anchore/sbom-action@3ad7283483fc7af8ff2b4ea19663c2d5ca935e26 # v0.24.2
|
|
with:
|
|
artifact-name: frontend-build.spdx
|
|
path: src/frontend
|
|
- name: Write version file - SHA
|
|
run: cd src/backend/InvenTree/web/static/web/.vite && echo "$GITHUB_SHA" > sha.txt
|
|
- name: Write version file - TAG
|
|
run: cd src/backend/InvenTree/web/static/web/.vite && echo "${REF_NAME}" > tag.txt
|
|
env:
|
|
REF_NAME: ${{ github.ref_name }}
|
|
- name: Write version file - SOURCE
|
|
run: cd src/backend/InvenTree/web/static/web/.vite && echo "GitHub Actions build on $(date --utc +%Y-%m-%dT%H:%M:%SZ)" > source.txt
|
|
- name: Zip frontend
|
|
run: |
|
|
cd src/backend/InvenTree/web/static/web
|
|
zip -r ../frontend-build.zip * .vite
|
|
- name: Attest Build Provenance
|
|
id: attest
|
|
uses: actions/attest@1e69f48acb82d1966a394da916b4c1698aa569d6 # v4.2.2
|
|
with:
|
|
subject-path: "${{ github.workspace }}/src/backend/InvenTree/web/static/frontend-build.zip"
|
|
|
|
- name: Upload frontend
|
|
run: gh release upload ${REF} src/backend/InvenTree/web/static/frontend-build.zip#frontend-build.zip
|
|
env:
|
|
REF: ${{ github.ref_name }}
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Upload frontend to artifacts
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
with:
|
|
name: frontend-build
|
|
path: src/backend/InvenTree/web/static/frontend-build.zip
|
|
- name: Rename Attestation Bundle
|
|
run: |
|
|
mv ${BUNDLE_PATH} src/backend/InvenTree/web/static/frontend-build.intoto.jsonl
|
|
env:
|
|
BUNDLE_PATH: ${{ steps.attest.outputs.bundle-path}}
|
|
- name: Upload Attestation
|
|
run: gh release upload ${REF} src/backend/InvenTree/web/static/frontend-build.intoto.jsonl#frontend-build.intoto.jsonl
|
|
env:
|
|
REF: ${{ github.ref_name }}
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
docs:
|
|
runs-on: ubuntu-24.04
|
|
name: Build and publish documentation
|
|
permissions:
|
|
contents: write
|
|
env:
|
|
INVENTREE_DB_ENGINE: sqlite3
|
|
INVENTREE_DB_NAME: inventree
|
|
INVENTREE_MEDIA_ROOT: /home/runner/work/InvenTree/test_inventree_media
|
|
INVENTREE_STATIC_ROOT: /home/runner/work/InvenTree/test_inventree_static
|
|
INVENTREE_BACKUP_DIR: /home/runner/work/InvenTree/test_inventree_backup
|
|
INVENTREE_SITE_URL: http://localhost:8000
|
|
INVENTREE_DEBUG: true
|
|
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
- name: Environment Setup
|
|
uses: ./.github/actions/setup
|
|
with:
|
|
install: true
|
|
npm: true
|
|
- name: Install dependencies
|
|
run: |
|
|
pip install --require-hashes -r contrib/dev_reqs/requirements.txt
|
|
pip install --require-hashes -r docs/requirements.txt
|
|
- name: Build documentation
|
|
run: |
|
|
invoke build-docs --mkdocs
|
|
- name: Zip build docs
|
|
run: |
|
|
cd docs/site
|
|
zip -r docs-html.zip *
|
|
- name: Publish documentation
|
|
run: gh release upload ${REF} docs/site/docs-html.zip#docs-html.zip
|
|
env:
|
|
REF: ${{ github.ref_name }}
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
build-pkgr:
|
|
if: github.repository == 'inventree/InvenTree'
|
|
name: ${{ matrix.target }}
|
|
runs-on: ubuntu-latest
|
|
needs: [build]
|
|
permissions:
|
|
contents: write
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
target:
|
|
- ubuntu:24.04
|
|
- ubuntu:26.04
|
|
- debian:13
|
|
|
|
steps:
|
|
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
fetch-depth: 0
|
|
persist-credentials: false
|
|
- name: Get frontend artifact
|
|
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
|
with:
|
|
name: frontend-build
|
|
- name: Setup
|
|
id: setup
|
|
env:
|
|
NODE_ID: ${{ github.event.release.node_id }}
|
|
BRANCH: ${{ github.event.release.target_commitish }}
|
|
TARGET: ${{github.event.release.target_commitish}}
|
|
REPO: ${{ github.repository }}
|
|
VERSION_REF: ${{ github.ref_name }}
|
|
GH_TOKEN: ${{ github.token }}
|
|
|
|
run: |
|
|
# Get info
|
|
gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /repos/$REPO/commits/$TARGET > commit.json
|
|
|
|
# Extract info
|
|
echo "INFO extract | Extracting info from github"
|
|
DATE=$(jq -r '.commit.committer.date' commit.json)
|
|
SIGNATURE=$(jq -r '.commit.verification.signature' commit.json)
|
|
FULL_SHA=$(jq -r '.sha' commit.json)
|
|
SHA=$(echo "$FULL_SHA" | cut -c1-7)
|
|
|
|
echo "INFO write | Write VERSION information"
|
|
echo "$VERSION" > VERSION
|
|
echo "INVENTREE_COMMIT_HASH='$SHA'" >> VERSION
|
|
echo "INVENTREE_COMMIT_SHA='$FULL_SHA'" >> VERSION
|
|
echo "INVENTREE_COMMIT_DATE='$DATE'" >> VERSION
|
|
echo "INVENTREE_PKG_INSTALLER='PKG'" >> VERSION
|
|
echo "INVENTREE_PKG_BRANCH='$BRANCH'" >> VERSION
|
|
echo "INVENTREE_PKG_TARGET='$TARGET'" >> VERSION
|
|
echo "NODE_ID='$NODE_ID'" >> VERSION
|
|
echo "SIGNATURE='$SIGNATURE'" >> VERSION
|
|
|
|
echo "INFO write | Written VERSION information"
|
|
echo "### VERSION ###"
|
|
cat VERSION
|
|
echo "### VERSION ###"
|
|
|
|
# Move frontend build into place
|
|
mkdir -p src/backend/InvenTree/web/static
|
|
unzip -qq frontend-build.zip -d src/backend/InvenTree/web/static/web
|
|
|
|
echo "INFO write release_version"
|
|
echo "VERSION=$VERSION_REF" >> $GITHUB_OUTPUT
|
|
echo "REF=$GITHUB_REF" >> $GITHUB_OUTPUT
|
|
|
|
# Disable before.sh for now - will need to be removed once we switch to go.packager.io fully
|
|
echo "#!/bin/bash" > contrib/packager.io/before.sh
|
|
|
|
echo "calculate release channel"
|
|
pip install --require-hashes -r contrib/dev_reqs/requirements.txt
|
|
python3 .github/scripts/version_check.py
|
|
- name: cleanup
|
|
run: |
|
|
# remove .map files from static build - these are only needed for debug
|
|
find src/backend/InvenTree/web/static/web -name "*.map" -type f -delete
|
|
# remove the whole docs dir - we are not doing anything with them
|
|
rm -rf docs
|
|
- name: Package - current release channel
|
|
uses: pkgr/action/package@c5666febcd31750da6428042193fc5b2fb765435 # main
|
|
id: package
|
|
with:
|
|
target: ${{ matrix.target }}
|
|
version: ${{ steps.setup.outputs.version }}
|
|
debug: true
|
|
cache_prefix: ${{ github.ref_name }}
|
|
env: |
|
|
INVENTREE_DB_ENGINE=sqlite3
|
|
INVENTREE_DB_NAME=database.sqlite3
|
|
INVENTREE_PLUGINS_ENABLED=true
|
|
INVENTREE_MEDIA_ROOT=/opt/inventree/media
|
|
INVENTREE_STATIC_ROOT=/opt/inventree/static
|
|
INVENTREE_BACKUP_DIR=/opt/inventree/backup
|
|
INVENTREE_PLUGIN_FILE=/opt/inventree/plugins.txt
|
|
INVENTREE_CONFIG_FILE=/opt/inventree/config.yaml
|
|
APP_REPO=inventree/InvenTree
|
|
- name: Publish to go.packager.io - current release channel
|
|
uses: pkgr/action/publish@c5666febcd31750da6428042193fc5b2fb765435 # main
|
|
with:
|
|
target: ${{ matrix.target }}
|
|
token: ${{ secrets.PACKAGER_RELEASE_TOKEN }}
|
|
repository: inventree/InvenTree
|
|
channel: ${{ env.pkg_channel }}
|
|
file: ${{ steps.package.outputs.package_path }}
|
|
- name: Publish to artifact
|
|
run: gh release upload ${REF} ${PACKAGE_PATH}#${PACKAGE_NAME}
|
|
env:
|
|
REF: ${{ github.ref_name }}
|
|
PACKAGE_PATH: ${{ steps.package.outputs.package_path }}
|
|
PACKAGE_NAME: ${{ matrix.target }}-${{ steps.setup.outputs.version }}.tar.gz
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Package - stable release channel
|
|
uses: pkgr/action/package@c5666febcd31750da6428042193fc5b2fb765435 # main
|
|
id: package-stable
|
|
with:
|
|
target: ${{ matrix.target }}
|
|
version: ${{ steps.setup.outputs.version }}
|
|
debug: true
|
|
cache_prefix: ${{ github.ref_name }}
|
|
env: |
|
|
INVENTREE_DB_ENGINE=sqlite3
|
|
INVENTREE_DB_NAME=database.sqlite3
|
|
INVENTREE_PLUGINS_ENABLED=true
|
|
INVENTREE_MEDIA_ROOT=/opt/inventree/media
|
|
INVENTREE_STATIC_ROOT=/opt/inventree/static
|
|
INVENTREE_BACKUP_DIR=/opt/inventree/backup
|
|
INVENTREE_PLUGIN_FILE=/opt/inventree/plugins.txt
|
|
INVENTREE_CONFIG_FILE=/opt/inventree/config.yaml
|
|
APP_REPO=inventree/InvenTree
|
|
- name: Publish to go.packager.io - stable release channel
|
|
uses: pkgr/action/publish@c5666febcd31750da6428042193fc5b2fb765435 # main
|
|
with:
|
|
target: ${{ matrix.target }}
|
|
token: ${{ secrets.PACKAGER_RELEASE_TOKEN }}
|
|
repository: inventree/InvenTree
|
|
channel: stable
|
|
file: ${{ steps.package-stable.outputs.package_path }}
|