git: ignore .secrets file, actions: init dmsbg-100 workflow
Some checks failed
/ build-and-publish (push) Failing after 1s
Some checks failed
/ build-and-publish (push) Failing after 1s
This commit is contained in:
parent
f00aa9947a
commit
bd5f81704c
2 changed files with 68 additions and 0 deletions
67
.forgejo/workflows/dmsbg-100.yml
Normal file
67
.forgejo/workflows/dmsbg-100.yml
Normal file
|
@ -0,0 +1,67 @@
|
|||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*.*.*'
|
||||
|
||||
env:
|
||||
GIT_PAT: ${{ secrets.GIT_PAT }}
|
||||
PORTAL_ENDPOINT: ${{ secrets.PORTAL_ENDPOINT }}
|
||||
PORTAL_API_KEY: ${{ secrets.PORTAL_API_KEY }}
|
||||
|
||||
jobs:
|
||||
build-and-publish:
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- name: Determine Environment
|
||||
id: determine-env
|
||||
run: |
|
||||
TAG_REF=${GITHUB_REF#refs/tags/}
|
||||
IFS='.' read -ra VERSION <<< "$TAG_REF"
|
||||
if [[ ${VERSION[2]} -eq 0 ]]; then
|
||||
echo "ENVIRONMENT=Production" >> $GITHUB_ENV
|
||||
else
|
||||
echo "ENVIRONMENT=Staging" >> $GITHUB_ENV
|
||||
|
||||
- name: Cache DifOS Build Directory
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
key: ${{ runner.os }}-${{ steps.determine-env.outputs.cache-prefix }}-difos-${{ hashFiles('**/dmsbg100.config') }}-${{ github.sha }}
|
||||
path: .
|
||||
restore-keys: |
|
||||
${{ runner.os }}-${{ steps.determine-env.outputs.cache-prefix }}-difos-${{ hashFiles('**/dmsbg100.config') }}
|
||||
${{ runner.os }}-${{ steps.determine-env.outputs.cache-prefix }}-difos-
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Dependencies
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y build-essential clang flex bison g++ gawk gcc-multilib g++-multilib gettext libncurses-dev libssl-dev python3-distutils rsync unzip zlib1g-dev file wget python3-setuptools swig
|
||||
npm install -g pkg@5.8.1
|
||||
|
||||
- name: Add Custom Files
|
||||
run: |
|
||||
echo $GIT_PAT
|
||||
git clone https://$GIT_PAT:x-oauth-basic@git.difuse.io/Difuse/difos-files.git
|
||||
cd difos-files
|
||||
./setup-all.sh ${{ github.workspace }} $GIT_PAT
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
./scripts/feeds update -a
|
||||
./scripts/feeds install -a
|
||||
cp -rf configs/dmsbg100.config .config
|
||||
make defconfig
|
||||
FORCE_UNSAFE_CONFIGURE=1 CONFIG_TARGET_ROOTFS_INITRAMFS=n make clean -j$(nproc)
|
||||
FORCE_UNSAFE_CONFIGURE=1 CONFIG_TARGET_ROOTFS_INITRAMFS=n make download -j$(nproc)
|
||||
FORCE_UNSAFE_CONFIGURE=1 CONFIG_TARGET_ROOTFS_INITRAMFS=n make world -j$(nproc)
|
||||
|
||||
- name: Publish Release
|
||||
run: |
|
||||
difosDir='.'
|
||||
cd $difosDir
|
||||
sdFile=$(find ./bin/ -name "*difos*" | grep sdcard | head -n1)
|
||||
sqFile=$(find ./bin/ -name "*difos*" | grep squash | head -n1)
|
||||
curl -X POST -H 'Content-Type: multipart/form-data' -F "file=@$sdFile" http://$PORTAL_ENDPOINT/software/upload/sd/$ENVIRONMENT/${{ env.PORTAL_API_KEY }}
|
||||
curl -X POST -H 'Content-Type: multipart/form-data' -F "file=@$sqFile" http://$PORTAL_ENDPOINT/software/upload/sysupgrade/$ENVIRONMENT/${{ env.PORTAL_API_KEY }}
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -33,3 +33,4 @@ git-src
|
|||
.cproject
|
||||
.ccache
|
||||
.vscode*
|
||||
.secrets
|
||||
|
|
Loading…
Reference in a new issue