mirror of
https://github.com/inventree/InvenTree.git
synced 2026-03-21 19:54:40 +00:00
Bumps the dependencies group with 7 updates: | Package | From | To | | --- | --- | --- | | [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action) | `3.7.0` | `4.0.0` | | [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action) | `3.12.0` | `4.0.0` | | [sigstore/cosign-installer](https://github.com/sigstore/cosign-installer) | `4.0.0` | `4.1.0` | | [docker/login-action](https://github.com/docker/login-action) | `3.7.0` | `4.0.0` | | [docker/metadata-action](https://github.com/docker/metadata-action) | `5.10.0` | `6.0.0` | | [CodSpeedHQ/action](https://github.com/codspeedhq/action) | `4.5.2` | `4.11.1` | | [anchore/sbom-action](https://github.com/anchore/sbom-action) | `0.22.2` | `0.23.1` | Updates `docker/setup-qemu-action` from 3.7.0 to 4.0.0 - [Release notes](https://github.com/docker/setup-qemu-action/releases) - [Commits](c7c5346462...ce360397dd) Updates `docker/setup-buildx-action` from 3.12.0 to 4.0.0 - [Release notes](https://github.com/docker/setup-buildx-action/releases) - [Commits](8d2750c68a...4d04d5d948) Updates `sigstore/cosign-installer` from 4.0.0 to 4.1.0 - [Release notes](https://github.com/sigstore/cosign-installer/releases) - [Commits](faadad0cce...ba7bc0a3fe) Updates `docker/login-action` from 3.7.0 to 4.0.0 - [Release notes](https://github.com/docker/login-action/releases) - [Commits](c94ce9fb46...b45d80f862) Updates `docker/metadata-action` from 5.10.0 to 6.0.0 - [Release notes](https://github.com/docker/metadata-action/releases) - [Commits](c299e40c65...030e881283) Updates `CodSpeedHQ/action` from 4.5.2 to 4.11.1 - [Release notes](https://github.com/codspeedhq/action/releases) - [Changelog](https://github.com/CodSpeedHQ/action/blob/main/CHANGELOG.md) - [Commits](dbda7111f8...281164b0f0) Updates `anchore/sbom-action` from 0.22.2 to 0.23.1 - [Release notes](https://github.com/anchore/sbom-action/releases) - [Changelog](https://github.com/anchore/sbom-action/blob/main/RELEASE.md) - [Commits](28d71544de...57aae52805) --- updated-dependencies: - dependency-name: docker/setup-qemu-action dependency-version: 4.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: dependencies - dependency-name: docker/setup-buildx-action dependency-version: 4.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: dependencies - dependency-name: sigstore/cosign-installer dependency-version: 4.1.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dependencies - dependency-name: docker/login-action dependency-version: 4.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: dependencies - dependency-name: docker/metadata-action dependency-version: 6.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: dependencies - dependency-name: CodSpeedHQ/action dependency-version: 4.11.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dependencies - dependency-name: anchore/sbom-action dependency-version: 0.23.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dependencies ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
254 lines
9.3 KiB
YAML
254 lines
9.3 KiB
YAML
# Runs on releases
|
|
|
|
name: Publish release
|
|
on:
|
|
release:
|
|
types: [published]
|
|
permissions:
|
|
contents: read
|
|
env:
|
|
python_version: 3.11
|
|
|
|
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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # pin@v6.0.2
|
|
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@77c5b412c50b723d2a4fbc6d71fb5723bcd439aa # pin@v1.0.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
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # pin@v6.0.2
|
|
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@57aae528053a48a3f6235f2d9461b05fbcb7366d # pin@v0
|
|
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-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32 # pin@v1
|
|
with:
|
|
subject-path: "${{ github.workspace }}/src/backend/InvenTree/web/static/frontend-build.zip"
|
|
|
|
- name: Upload frontend
|
|
uses: svenstaro/upload-release-action@b98a3b12e86552593f3e4e577ca8a62aa2f3f22b # pin@2.11.4
|
|
with:
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
file: src/backend/InvenTree/web/static/frontend-build.zip
|
|
asset_name: frontend-build.zip
|
|
tag: ${{ github.ref }}
|
|
overwrite: true
|
|
- name: Upload frontend to artifacts
|
|
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # pin@v7.0.0
|
|
with:
|
|
name: frontend-build
|
|
path: src/backend/InvenTree/web/static/frontend-build.zip
|
|
- name: Upload Attestation
|
|
uses: svenstaro/upload-release-action@b98a3b12e86552593f3e4e577ca8a62aa2f3f22b # pin@2.11.4
|
|
with:
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
asset_name: frontend-build.intoto.jsonl
|
|
file: ${{ steps.attest.outputs.bundle-path}}
|
|
tag: ${{ github.ref }}
|
|
overwrite: true
|
|
|
|
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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # pin@v6.0.2
|
|
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
|
|
uses: svenstaro/upload-release-action@b98a3b12e86552593f3e4e577ca8a62aa2f3f22b # pin@2.11.4
|
|
with:
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
file: docs/site/docs-html.zip
|
|
asset_name: docs-html.zip
|
|
tag: ${{ github.ref }}
|
|
overwrite: true
|
|
|
|
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:22.04
|
|
- ubuntu:24.04
|
|
- debian:12
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # pin@v6.0.2
|
|
with:
|
|
fetch-depth: 0
|
|
persist-credentials: false
|
|
|
|
- name: Get frontend artifact
|
|
uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # pin@v8.0.0
|
|
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: Package
|
|
uses: pkgr/action/package@c5666febcd31750da6428042193fc5b2fb765435 # pin@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
|
|
uses: pkgr/action/publish@3bce081ae512c5020856e237d37b3f5479d4aa71 # pin@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
|
|
uses: svenstaro/upload-release-action@b98a3b12e86552593f3e4e577ca8a62aa2f3f22b # pin@2.11.4
|
|
with:
|
|
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
file: ${{ steps.package.outputs.package_path }}
|
|
asset_name: ${{ matrix.target }}-{{ steps.setup.outputs.version }}.tar.gz
|
|
tag: ${{ github.ref }}
|
|
overwrite: true
|