mirror of
https://github.com/inventree/InvenTree.git
synced 2026-09-16 09:22:57 +00:00
more hardening of ci steps (#12834)
* fix rule: zizmor/self-repository * pin to version * fix --proto "=https" * another shell:S6506 * fix shell:S8541 * fix githubactions:S8541 * fix githubactions:S8541 * more sec fixes * fix psycopg version * more script disabling on frontend
This commit is contained in:
@@ -18,16 +18,16 @@ rm -f /home/vscode/.gitconfig
|
|||||||
# Fix issue related to CFFI version mismatch
|
# Fix issue related to CFFI version mismatch
|
||||||
pip uninstall cffi -y
|
pip uninstall cffi -y
|
||||||
sudo apt remove --purge -y python3-cffi
|
sudo apt remove --purge -y python3-cffi
|
||||||
pip install --no-cache-dir --force-reinstall --ignore-installed cffi
|
pip install --only-binary :all: --no-cache-dir --force-reinstall --ignore-installed cffi
|
||||||
|
|
||||||
# Upgrade pip
|
# Upgrade pip
|
||||||
python3 -m pip install --upgrade pip
|
python3 -m pip install --upgrade pip
|
||||||
|
|
||||||
# Ensure the correct invoke is available
|
# Ensure the correct invoke is available
|
||||||
pip3 install --ignore-installed --upgrade invoke Pillow
|
pip3 install --only-binary :all: --ignore-installed --upgrade invoke Pillow
|
||||||
|
|
||||||
# install base level packages
|
# install base level packages
|
||||||
pip3 install -Ur contrib/container/requirements.txt --require-hashes
|
pip3 install --only-binary :all: -Ur contrib/container/requirements.txt --require-hashes
|
||||||
|
|
||||||
# Run initial InvenTree server setup
|
# Run initial InvenTree server setup
|
||||||
invoke update -s
|
invoke update -s
|
||||||
|
|||||||
@@ -65,15 +65,15 @@ runs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
python3 -m pip install -U pip
|
python3 -m pip install -U pip
|
||||||
pip3 install -U invoke wheel
|
pip3 install --only-binary :all: -U invoke wheel
|
||||||
pip3 install 'uv>=0.9.6'
|
pip3 install --only-binary :all: 'uv>=0.9.6'
|
||||||
- name: Allow uv to use the system Python by default
|
- name: Allow uv to use the system Python by default
|
||||||
run: echo "UV_SYSTEM_PYTHON=1" >> $GITHUB_ENV
|
run: echo "UV_SYSTEM_PYTHON=1" >> $GITHUB_ENV
|
||||||
shell: bash
|
shell: bash
|
||||||
- name: Install Specific Python Dependencies
|
- name: Install Specific Python Dependencies
|
||||||
if: ${{ inputs.pip-dependency }}
|
if: ${{ inputs.pip-dependency }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: uv pip install ${PIP_DEPS}
|
run: "uv pip install ${PIP_DEPS}" # TODO remove building once mysqlclient is available as a wheel
|
||||||
env:
|
env:
|
||||||
PIP_DEPS: ${{ inputs.pip-dependency }}
|
PIP_DEPS: ${{ inputs.pip-dependency }}
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ jobs:
|
|||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Environment Setup
|
- name: Environment Setup
|
||||||
uses: ./.github/actions/setup
|
uses: $/.github/actions/setup
|
||||||
with:
|
with:
|
||||||
install: true
|
install: true
|
||||||
apt-dependency: gettext
|
apt-dependency: gettext
|
||||||
|
|||||||
@@ -73,11 +73,11 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
- name: Environment Setup
|
- name: Environment Setup
|
||||||
uses: ./.github/actions/setup
|
uses: $/.github/actions/setup
|
||||||
with:
|
with:
|
||||||
npm: true
|
npm: true
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: cd src/frontend && yarn install
|
run: cd src/frontend && yarn install --ignore-scripts
|
||||||
- name: Build frontend
|
- name: Build frontend
|
||||||
run: cd src/frontend && yarn run compile && yarn run lib && yarn run build
|
run: cd src/frontend && yarn run compile && yarn run lib && yarn run build
|
||||||
- name: Write version file - SHA
|
- name: Write version file - SHA
|
||||||
@@ -127,13 +127,13 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
- name: Environment Setup
|
- name: Environment Setup
|
||||||
uses: ./.github/actions/setup
|
uses: $/.github/actions/setup
|
||||||
with:
|
with:
|
||||||
npm: true
|
npm: true
|
||||||
install: true
|
install: true
|
||||||
update: true
|
update: true
|
||||||
apt-dependency: gettext postgresql-client libpq-dev
|
apt-dependency: gettext postgresql-client libpq-dev
|
||||||
pip-dependency: psycopg2
|
pip-dependency: psycopg
|
||||||
- name: Set up test data
|
- name: Set up test data
|
||||||
run: |
|
run: |
|
||||||
invoke dev.setup-test -iv
|
invoke dev.setup-test -iv
|
||||||
@@ -148,10 +148,10 @@ jobs:
|
|||||||
key: ${{ runner.os }}-playwright-${{ hashFiles('src/frontend/yarn.lock') }}
|
key: ${{ runner.os }}-playwright-${{ hashFiles('src/frontend/yarn.lock') }}
|
||||||
- name: Install Playwright browsers
|
- name: Install Playwright browsers
|
||||||
if: steps.playwright-cache.outputs.cache-hit != 'true'
|
if: steps.playwright-cache.outputs.cache-hit != 'true'
|
||||||
run: cd src/frontend && npx playwright install --with-deps
|
run: cd src/frontend && npx --ignore-scripts playwright install --with-deps
|
||||||
- name: Install Playwright OS dependencies
|
- name: Install Playwright OS dependencies
|
||||||
if: steps.playwright-cache.outputs.cache-hit == 'true'
|
if: steps.playwright-cache.outputs.cache-hit == 'true'
|
||||||
run: cd src/frontend && npx playwright install-deps
|
run: cd src/frontend && npx --ignore-scripts playwright install-deps
|
||||||
- name: Install Sample Plugin
|
- name: Install Sample Plugin
|
||||||
run: |
|
run: |
|
||||||
pip install -U inventree-plugin-creator==${{ env.plugin_creator_version }}
|
pip install -U inventree-plugin-creator==${{ env.plugin_creator_version }}
|
||||||
@@ -164,7 +164,7 @@ jobs:
|
|||||||
cp ./tests/fixtures/playwright_custom_logo.png ../backend/InvenTree/InvenTree/static/img/playwright_custom_logo.png
|
cp ./tests/fixtures/playwright_custom_logo.png ../backend/InvenTree/InvenTree/static/img/playwright_custom_logo.png
|
||||||
cp ./tests/fixtures/playwright_custom_splash.png ../backend/InvenTree/InvenTree/static/img/playwright_custom_splash.png
|
cp ./tests/fixtures/playwright_custom_splash.png ../backend/InvenTree/InvenTree/static/img/playwright_custom_splash.png
|
||||||
invoke static
|
invoke static
|
||||||
env INVENTREE_CUSTOM_SPLASH="img/playwright_custom_splash.png" INVENTREE_CUSTOM_LOGO="img/playwright_custom_logo.png" PLAYWRIGHT_BASE_URL=http://localhost:8000 npx playwright test --project=firefox --shard=${{ matrix.shard }}/2
|
env INVENTREE_CUSTOM_SPLASH="img/playwright_custom_splash.png" INVENTREE_CUSTOM_LOGO="img/playwright_custom_logo.png" PLAYWRIGHT_BASE_URL=http://localhost:8000 npx --ignore-scripts playwright test --project=firefox --shard=${{ matrix.shard }}/2
|
||||||
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||||
if: ${{ !cancelled() && steps.tests.outcome == 'failure' }}
|
if: ${{ !cancelled() && steps.tests.outcome == 'failure' }}
|
||||||
with:
|
with:
|
||||||
@@ -209,13 +209,13 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
- name: Environment Setup
|
- name: Environment Setup
|
||||||
uses: ./.github/actions/setup
|
uses: $/.github/actions/setup
|
||||||
with:
|
with:
|
||||||
npm: true
|
npm: true
|
||||||
install: true
|
install: true
|
||||||
update: true
|
update: true
|
||||||
apt-dependency: gettext postgresql-client libpq-dev
|
apt-dependency: gettext postgresql-client libpq-dev
|
||||||
pip-dependency: psycopg2
|
pip-dependency: psycopg
|
||||||
- name: Set up test data
|
- name: Set up test data
|
||||||
run: |
|
run: |
|
||||||
invoke dev.setup-test -iv
|
invoke dev.setup-test -iv
|
||||||
@@ -230,10 +230,10 @@ jobs:
|
|||||||
key: ${{ runner.os }}-playwright-${{ hashFiles('src/frontend/yarn.lock') }}
|
key: ${{ runner.os }}-playwright-${{ hashFiles('src/frontend/yarn.lock') }}
|
||||||
- name: Install Playwright browsers
|
- name: Install Playwright browsers
|
||||||
if: steps.playwright-cache.outputs.cache-hit != 'true'
|
if: steps.playwright-cache.outputs.cache-hit != 'true'
|
||||||
run: cd src/frontend && npx playwright install --with-deps
|
run: cd src/frontend && npx --ignore-scripts playwright install --with-deps
|
||||||
- name: Install Playwright OS dependencies
|
- name: Install Playwright OS dependencies
|
||||||
if: steps.playwright-cache.outputs.cache-hit == 'true'
|
if: steps.playwright-cache.outputs.cache-hit == 'true'
|
||||||
run: cd src/frontend && npx playwright install-deps
|
run: cd src/frontend && npx --ignore-scripts playwright install-deps
|
||||||
- name: Install Sample Plugin
|
- name: Install Sample Plugin
|
||||||
run: |
|
run: |
|
||||||
pip install -U inventree-plugin-creator==${{ env.plugin_creator_version }}
|
pip install -U inventree-plugin-creator==${{ env.plugin_creator_version }}
|
||||||
@@ -243,7 +243,7 @@ jobs:
|
|||||||
id: tests
|
id: tests
|
||||||
run: |
|
run: |
|
||||||
cd src/frontend
|
cd src/frontend
|
||||||
npx nyc playwright test --project=chromium --shard=${{ matrix.shard }}/4
|
npx --ignore-scripts nyc playwright test --project=chromium --shard=${{ matrix.shard }}/4
|
||||||
- name: Playwright Report [${{ matrix.shard }} / 4]
|
- name: Playwright Report [${{ matrix.shard }} / 4]
|
||||||
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
||||||
if: ${{ !cancelled() && steps.tests.outcome == 'failure' }}
|
if: ${{ !cancelled() && steps.tests.outcome == 'failure' }}
|
||||||
@@ -278,7 +278,7 @@ jobs:
|
|||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Environment Setup
|
- name: Environment Setup
|
||||||
uses: ./.github/actions/setup
|
uses: $/.github/actions/setup
|
||||||
with:
|
with:
|
||||||
npm: true
|
npm: true
|
||||||
install: false
|
install: false
|
||||||
@@ -295,8 +295,8 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
mkdir -p .nyc_output
|
mkdir -p .nyc_output
|
||||||
cp all-coverage/*.json .nyc_output/ 2>/dev/null || true
|
cp all-coverage/*.json .nyc_output/ 2>/dev/null || true
|
||||||
npx nyc merge .nyc_output merged-coverage.json
|
npx --ignore-scripts nyc merge .nyc_output merged-coverage.json
|
||||||
npx nyc report \
|
npx --ignore-scripts nyc report \
|
||||||
--tempdir .nyc_output \
|
--tempdir .nyc_output \
|
||||||
--reporter=lcov \
|
--reporter=lcov \
|
||||||
--reporter=text-summary \
|
--reporter=text-summary \
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
- name: Environment Setup
|
- name: Environment Setup
|
||||||
uses: ./.github/actions/setup
|
uses: $/.github/actions/setup
|
||||||
with:
|
with:
|
||||||
apt-dependency: gettext poppler-utils libpq-dev
|
apt-dependency: gettext poppler-utils libpq-dev
|
||||||
pip-dependency: psycopg
|
pip-dependency: psycopg
|
||||||
@@ -154,7 +154,7 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
- name: Environment Setup
|
- name: Environment Setup
|
||||||
uses: ./.github/actions/setup
|
uses: $/.github/actions/setup
|
||||||
with:
|
with:
|
||||||
apt-dependency: gettext poppler-utils libpq-dev
|
apt-dependency: gettext poppler-utils libpq-dev
|
||||||
pip-dependency: psycopg
|
pip-dependency: psycopg
|
||||||
@@ -218,7 +218,7 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
- name: Environment Setup
|
- name: Environment Setup
|
||||||
uses: ./.github/actions/setup
|
uses: $/.github/actions/setup
|
||||||
with:
|
with:
|
||||||
apt-dependency: gettext poppler-utils libpq-dev
|
apt-dependency: gettext poppler-utils libpq-dev
|
||||||
pip-dependency: psycopg
|
pip-dependency: psycopg
|
||||||
@@ -292,7 +292,7 @@ jobs:
|
|||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
- name: Environment Setup
|
- name: Environment Setup
|
||||||
uses: ./.github/actions/setup
|
uses: $/.github/actions/setup
|
||||||
with:
|
with:
|
||||||
apt-dependency: gettext poppler-utils libpq-dev
|
apt-dependency: gettext poppler-utils libpq-dev
|
||||||
pip-dependency: psycopg
|
pip-dependency: psycopg
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
- name: Environment Setup
|
- name: Environment Setup
|
||||||
uses: ./.github/actions/setup
|
uses: $/.github/actions/setup
|
||||||
with:
|
with:
|
||||||
apt-dependency: gettext poppler-utils
|
apt-dependency: gettext poppler-utils
|
||||||
dev-install: true
|
dev-install: true
|
||||||
@@ -117,7 +117,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
- name: Environment Setup
|
- name: Environment Setup
|
||||||
uses: ./.github/actions/setup
|
uses: $/.github/actions/setup
|
||||||
with:
|
with:
|
||||||
apt-dependency: gettext poppler-utils libmysqlclient-dev
|
apt-dependency: gettext poppler-utils libmysqlclient-dev
|
||||||
pip-dependency: mysqlclient
|
pip-dependency: mysqlclient
|
||||||
@@ -164,7 +164,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
- name: Environment Setup
|
- name: Environment Setup
|
||||||
uses: ./.github/actions/setup
|
uses: $/.github/actions/setup
|
||||||
with:
|
with:
|
||||||
apt-dependency: gettext poppler-utils libpq-dev
|
apt-dependency: gettext poppler-utils libpq-dev
|
||||||
pip-dependency: psycopg
|
pip-dependency: psycopg
|
||||||
@@ -199,7 +199,7 @@ jobs:
|
|||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
name: Checkout Code
|
name: Checkout Code
|
||||||
- name: Environment Setup
|
- name: Environment Setup
|
||||||
uses: ./.github/actions/setup
|
uses: $/.github/actions/setup
|
||||||
with:
|
with:
|
||||||
install: true
|
install: true
|
||||||
- name: Fetch Database
|
- name: Fetch Database
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ jobs:
|
|||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
- name: Environment Setup
|
- name: Environment Setup
|
||||||
id: setup
|
id: setup
|
||||||
uses: ./.github/actions/setup
|
uses: $/.github/actions/setup
|
||||||
with:
|
with:
|
||||||
apt-dependency: gettext poppler-utils
|
apt-dependency: gettext poppler-utils
|
||||||
dev-install: true
|
dev-install: true
|
||||||
@@ -188,7 +188,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
- name: Environment Setup
|
- name: Environment Setup
|
||||||
uses: ./.github/actions/setup
|
uses: $/.github/actions/setup
|
||||||
with:
|
with:
|
||||||
apt-dependency: gettext poppler-utils
|
apt-dependency: gettext poppler-utils
|
||||||
dev-install: true
|
dev-install: true
|
||||||
@@ -330,7 +330,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
- name: Environment Setup
|
- name: Environment Setup
|
||||||
uses: ./.github/actions/setup
|
uses: $/.github/actions/setup
|
||||||
with:
|
with:
|
||||||
apt-dependency: gettext poppler-utils
|
apt-dependency: gettext poppler-utils
|
||||||
dev-install: true
|
dev-install: true
|
||||||
@@ -388,7 +388,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
- name: Environment Setup
|
- name: Environment Setup
|
||||||
uses: ./.github/actions/setup
|
uses: $/.github/actions/setup
|
||||||
with:
|
with:
|
||||||
apt-dependency: gettext poppler-utils
|
apt-dependency: gettext poppler-utils
|
||||||
dev-install: true
|
dev-install: true
|
||||||
@@ -441,7 +441,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
- name: Environment Setup
|
- name: Environment Setup
|
||||||
uses: ./.github/actions/setup
|
uses: $/.github/actions/setup
|
||||||
with:
|
with:
|
||||||
apt-dependency: gettext poppler-utils
|
apt-dependency: gettext poppler-utils
|
||||||
dev-install: true
|
dev-install: true
|
||||||
@@ -492,7 +492,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
- name: Environment Setup
|
- name: Environment Setup
|
||||||
uses: ./.github/actions/setup
|
uses: $/.github/actions/setup
|
||||||
with:
|
with:
|
||||||
apt-dependency: gettext poppler-utils libpq-dev
|
apt-dependency: gettext poppler-utils libpq-dev
|
||||||
pip-dependency: psycopg django-redis>=5.0.0
|
pip-dependency: psycopg django-redis>=5.0.0
|
||||||
@@ -541,7 +541,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
- name: Environment Setup
|
- name: Environment Setup
|
||||||
uses: ./.github/actions/setup
|
uses: $/.github/actions/setup
|
||||||
with:
|
with:
|
||||||
apt-dependency: gettext poppler-utils libmysqlclient-dev
|
apt-dependency: gettext poppler-utils libmysqlclient-dev
|
||||||
pip-dependency: mysqlclient
|
pip-dependency: mysqlclient
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ jobs:
|
|||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
- name: Version Check
|
- name: Version Check
|
||||||
run: |
|
run: |
|
||||||
pip install --require-hashes -r contrib/dev_reqs/requirements.txt
|
pip install --require-hashes --only-binary :all: -r contrib/dev_reqs/requirements.txt
|
||||||
python3 .github/scripts/version_check.py
|
python3 .github/scripts/version_check.py
|
||||||
- name: Push to Stable Branch
|
- name: Push to Stable Branch
|
||||||
uses: ad-m/github-push-action@881a6320fdb16eb5318c5054f31c218aec2b324c # v1.3.0
|
uses: ad-m/github-push-action@881a6320fdb16eb5318c5054f31c218aec2b324c # v1.3.0
|
||||||
@@ -49,7 +49,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
- name: Environment Setup
|
- name: Environment Setup
|
||||||
uses: ./.github/actions/setup
|
uses: $/.github/actions/setup
|
||||||
with:
|
with:
|
||||||
npm: true
|
npm: true
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
@@ -119,14 +119,14 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
- name: Environment Setup
|
- name: Environment Setup
|
||||||
uses: ./.github/actions/setup
|
uses: $/.github/actions/setup
|
||||||
with:
|
with:
|
||||||
install: true
|
install: true
|
||||||
npm: true
|
npm: true
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
pip install --require-hashes -r contrib/dev_reqs/requirements.txt
|
pip install --require-hashes --only-binary :all: -r contrib/dev_reqs/requirements.txt
|
||||||
pip install --require-hashes -r docs/requirements.txt
|
pip install --require-hashes --only-binary :all: -r docs/requirements.txt
|
||||||
- name: Build documentation
|
- name: Build documentation
|
||||||
run: |
|
run: |
|
||||||
invoke build-docs --mkdocs
|
invoke build-docs --mkdocs
|
||||||
@@ -213,7 +213,7 @@ jobs:
|
|||||||
echo "#!/bin/bash" > contrib/packager.io/before.sh
|
echo "#!/bin/bash" > contrib/packager.io/before.sh
|
||||||
|
|
||||||
echo "calculate release channel"
|
echo "calculate release channel"
|
||||||
pip install --require-hashes -r contrib/dev_reqs/requirements.txt
|
pip install --require-hashes --only-binary :all: -r contrib/dev_reqs/requirements.txt
|
||||||
python3 .github/scripts/version_check.py
|
python3 .github/scripts/version_check.py
|
||||||
- name: cleanup
|
- name: cleanup
|
||||||
run: |
|
run: |
|
||||||
@@ -222,7 +222,7 @@ jobs:
|
|||||||
# remove the whole docs dir - we are not doing anything with them
|
# remove the whole docs dir - we are not doing anything with them
|
||||||
rm -rf docs
|
rm -rf docs
|
||||||
- name: Package - current release channel
|
- name: Package - current release channel
|
||||||
uses: pkgr/action/package@c5666febcd31750da6428042193fc5b2fb765435 # main
|
uses: pkgr/action/package@c5666febcd31750da6428042193fc5b2fb765435 # v1.0.2
|
||||||
id: package
|
id: package
|
||||||
with:
|
with:
|
||||||
name: inventree
|
name: inventree
|
||||||
@@ -241,7 +241,7 @@ jobs:
|
|||||||
INVENTREE_CONFIG_FILE=/opt/inventree/config.yaml
|
INVENTREE_CONFIG_FILE=/opt/inventree/config.yaml
|
||||||
APP_REPO=inventree/InvenTree
|
APP_REPO=inventree/InvenTree
|
||||||
- name: Publish to go.packager.io - current release channel
|
- name: Publish to go.packager.io - current release channel
|
||||||
uses: pkgr/action/publish@c5666febcd31750da6428042193fc5b2fb765435 # main
|
uses: pkgr/action/publish@c5666febcd31750da6428042193fc5b2fb765435 # v1.0.2
|
||||||
with:
|
with:
|
||||||
target: ${{ matrix.target }}
|
target: ${{ matrix.target }}
|
||||||
token: ${{ secrets.PACKAGER_RELEASE_TOKEN }}
|
token: ${{ secrets.PACKAGER_RELEASE_TOKEN }}
|
||||||
@@ -256,7 +256,7 @@ jobs:
|
|||||||
PACKAGE_NAME: ${{ matrix.target }}-${{ steps.setup.outputs.version }}.tar.gz
|
PACKAGE_NAME: ${{ matrix.target }}-${{ steps.setup.outputs.version }}.tar.gz
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
- name: Package - stable release channel
|
- name: Package - stable release channel
|
||||||
uses: pkgr/action/package@c5666febcd31750da6428042193fc5b2fb765435 # main
|
uses: pkgr/action/package@c5666febcd31750da6428042193fc5b2fb765435 # v1.0.2
|
||||||
id: package-stable
|
id: package-stable
|
||||||
with:
|
with:
|
||||||
name: inventree
|
name: inventree
|
||||||
@@ -275,7 +275,7 @@ jobs:
|
|||||||
INVENTREE_CONFIG_FILE=/opt/inventree/config.yaml
|
INVENTREE_CONFIG_FILE=/opt/inventree/config.yaml
|
||||||
APP_REPO=inventree/InvenTree
|
APP_REPO=inventree/InvenTree
|
||||||
- name: Publish to go.packager.io - stable release channel
|
- name: Publish to go.packager.io - stable release channel
|
||||||
uses: pkgr/action/publish@c5666febcd31750da6428042193fc5b2fb765435 # main
|
uses: pkgr/action/publish@c5666febcd31750da6428042193fc5b2fb765435 # v1.0.2
|
||||||
with:
|
with:
|
||||||
target: ${{ matrix.target }}
|
target: ${{ matrix.target }}
|
||||||
token: ${{ secrets.PACKAGER_RELEASE_TOKEN }}
|
token: ${{ secrets.PACKAGER_RELEASE_TOKEN }}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
- name: Environment Setup
|
- name: Environment Setup
|
||||||
uses: ./.github/actions/setup
|
uses: $/.github/actions/setup
|
||||||
with:
|
with:
|
||||||
install: true
|
install: true
|
||||||
apt-dependency: gettext
|
apt-dependency: gettext
|
||||||
|
|||||||
@@ -11,17 +11,17 @@ SHA=$(echo $APP_PKG_ITERATION | cut -d'.' -f2)
|
|||||||
|
|
||||||
# Download info
|
# Download info
|
||||||
echo "INFO collection | Getting info from github for commit $SHA"
|
echo "INFO collection | Getting info from github for commit $SHA"
|
||||||
curl -L -s -f \
|
curl -L -s -f --proto "=https" \
|
||||||
-H "Accept: application/vnd.github+json" \
|
-H "Accept: application/vnd.github+json" \
|
||||||
-H "X-GitHub-Api-Version: 2022-11-28" \
|
-H "X-GitHub-Api-Version: 2022-11-28" \
|
||||||
https://api.github.com/repos/$APP_REPO/commits/$SHA > commit.json
|
https://api.github.com/repos/$APP_REPO/commits/$SHA > commit.json
|
||||||
echo "INFO collection | Got commit.json with size $(wc -c commit.json)"
|
echo "INFO collection | Got commit.json with size $(wc -c commit.json)"
|
||||||
curl -L -s -f \
|
curl -L -s -f --proto "=https" \
|
||||||
-H "Accept: application/vnd.github+json" \
|
-H "Accept: application/vnd.github+json" \
|
||||||
-H "X-GitHub-Api-Version: 2022-11-28" \
|
-H "X-GitHub-Api-Version: 2022-11-28" \
|
||||||
https://api.github.com/repos/$APP_REPO/commits/$SHA/branches-where-head > branches.json
|
https://api.github.com/repos/$APP_REPO/commits/$SHA/branches-where-head > branches.json
|
||||||
echo "INFO collection | Got branches.json with size $(wc -c branches.json)"
|
echo "INFO collection | Got branches.json with size $(wc -c branches.json)"
|
||||||
curl -L -s -f \
|
curl -L -s -f --proto "=https" \
|
||||||
-H "Accept: application/vnd.github+json" \
|
-H "Accept: application/vnd.github+json" \
|
||||||
-H "X-GitHub-Api-Version: 2022-11-28" \
|
-H "X-GitHub-Api-Version: 2022-11-28" \
|
||||||
https://api.github.com/repos/$APP_REPO/commits/$APP_PKG_VERSION > tag.json
|
https://api.github.com/repos/$APP_REPO/commits/$APP_PKG_VERSION > tag.json
|
||||||
@@ -59,7 +59,7 @@ if [ "$TAG_SHA" != "$FULL_SHA" ]; then
|
|||||||
echo "INFO frontend | Tag sha '$TAG_SHA' is not the same as commit sha $FULL_SHA, can not download frontend"
|
echo "INFO frontend | Tag sha '$TAG_SHA' is not the same as commit sha $FULL_SHA, can not download frontend"
|
||||||
else
|
else
|
||||||
echo "INFO frontend | Getting frontend from github via tag"
|
echo "INFO frontend | Getting frontend from github via tag"
|
||||||
curl https://github.com/$APP_REPO/releases/download/$APP_PKG_VERSION/frontend-build.zip -L -O -f
|
curl https://github.com/$APP_REPO/releases/download/$APP_PKG_VERSION/frontend-build.zip -L -O -f --proto "=https"
|
||||||
mkdir -p src/backend/InvenTree/web/static
|
mkdir -p src/backend/InvenTree/web/static
|
||||||
echo "INFO frontend | Unzipping frontend"
|
echo "INFO frontend | Unzipping frontend"
|
||||||
unzip -qq frontend-build.zip -d src/backend/InvenTree/web/static/web
|
unzip -qq frontend-build.zip -d src/backend/InvenTree/web/static/web
|
||||||
|
|||||||
Reference in New Issue
Block a user