mirror of
https://github.com/inventree/InvenTree.git
synced 2026-02-19 13:18:03 +00:00
refactor(backend): switch release pipeline to new pkgr version (#11336)
* refactor(backend): switch release pipeline to new pkgr version * fix wrong assign * fix warnings * also publish to release artifacts
This commit is contained in:
100
.github/workflows/release.yaml
vendored
100
.github/workflows/release.yaml
vendored
@@ -85,6 +85,11 @@ jobs:
|
|||||||
asset_name: frontend-build.zip
|
asset_name: frontend-build.zip
|
||||||
tag: ${{ github.ref }}
|
tag: ${{ github.ref }}
|
||||||
overwrite: true
|
overwrite: true
|
||||||
|
- name: Upload frontend to artifacts
|
||||||
|
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # pin@v6.0.0
|
||||||
|
with:
|
||||||
|
name: frontend-build
|
||||||
|
path: src/backend/InvenTree/web/static/frontend-build.zip
|
||||||
- name: Upload Attestation
|
- name: Upload Attestation
|
||||||
uses: svenstaro/upload-release-action@6b7fa9f267e90b50a19fef07b3596790bb941741 # pin@2.11.3
|
uses: svenstaro/upload-release-action@6b7fa9f267e90b50a19fef07b3596790bb941741 # pin@2.11.3
|
||||||
with:
|
with:
|
||||||
@@ -136,3 +141,98 @@ jobs:
|
|||||||
asset_name: docs-html.zip
|
asset_name: docs-html.zip
|
||||||
tag: ${{ github.ref }}
|
tag: ${{ github.ref }}
|
||||||
overwrite: true
|
overwrite: true
|
||||||
|
|
||||||
|
build-pkgr:
|
||||||
|
if: github.repository == 'inventree/InvenTree'
|
||||||
|
name: ${{ matrix.target }}
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [build, docs]
|
||||||
|
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@37930b1c2abaa49bbe596cd826c3c89aef350131 # pin@v7.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 }}
|
||||||
|
|
||||||
|
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
|
||||||
|
- 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: ${{ github.ref_name }}
|
||||||
|
file: ${{ steps.package.outputs.package_path }}
|
||||||
|
- name: Publish to artifact
|
||||||
|
uses: svenstaro/upload-release-action@6b7fa9f267e90b50a19fef07b3596790bb941741 # pin@2.11.3
|
||||||
|
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
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ buildpack: https://github.com/matmair/null-buildpack#master
|
|||||||
env:
|
env:
|
||||||
- INVENTREE_DB_ENGINE=sqlite3
|
- INVENTREE_DB_ENGINE=sqlite3
|
||||||
- INVENTREE_DB_NAME=database.sqlite3
|
- INVENTREE_DB_NAME=database.sqlite3
|
||||||
- INVENTREE_PLUGINS_ENABLED
|
- INVENTREE_PLUGINS_ENABLED=true
|
||||||
- INVENTREE_MEDIA_ROOT=/opt/inventree/media
|
- INVENTREE_MEDIA_ROOT=/opt/inventree/media
|
||||||
- INVENTREE_STATIC_ROOT=/opt/inventree/static
|
- INVENTREE_STATIC_ROOT=/opt/inventree/static
|
||||||
- INVENTREE_BACKUP_DIR=/opt/inventree/backup
|
- INVENTREE_BACKUP_DIR=/opt/inventree/backup
|
||||||
|
|||||||
Reference in New Issue
Block a user