CasaOS/.github/workflows/casa.yml
Ikko Eltociear Ashimine 428be5f2c2
Update casa.yml (#1375)
enviroment -> environment

Signed-off-by: Ikko Eltociear Ashimine <eltociear@gmail.com>
Co-authored-by: Tiger Wang <tigerwang@outlook.com>
2023-09-04 07:36:38 +08:00

148 lines
3.8 KiB
YAML

# This is a basic workflow to help you get started with Actions
name: Build CasaOS
on:
repository_dispatch:
workflow_dispatch:
inputs:
ssh:
description: 'SSH connection to Actions'
required: false
default: 'false'
#on:
# push:
# branches:
# - 'main'
# tags:
# - 'v*'
env:
REPO_URL: https://github.com/IceWhaleTech/CasaOS.git
REPO_BRANCH: main
PACK_SH_URL: https://raw.githubusercontent.com/jerrykuku/actions-casa/main/pack.sh
PACK_SH: pack.sh
TZ: Asia/Shanghai
jobs:
xgo:
strategy:
fail-fast: false
matrix:
go_version:
- 1.17.1
runs-on: ubuntu-latest
steps:
# - name: Get release
# id: get_release
# uses: bruceadams/get-release@v1.2.3
# env:
# GITHUB_TOKEN: ${{ github.token }}
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
# - name: Initialization environment
# env:
# DEBIAN_FRONTEND: noninteractive
# run: |
# sudo timedatectl set-timezone "$TZ"
# sudo mkdir -p /workdir
# sudo chown $USER:$GROUPS /workdir
# - name: Clone source code
# working-directory: /workdir
# run: |
# df -hT $PWD
# git clone $REPO_URL -b $REPO_BRANCH --recursive casa
# ln -sf /workdir/casa $GITHUB_WORKSPACE/casa
# ls
- name: Set environment for github-release
run: |
echo "VERSION=$(cat types/system.go | grep CURRENTVERSION | awk '$2 == "CURRENTVERSION"{print $4}' | sed 's/"//g')" >>$GITHUB_ENV
echo "BODY=$(cat types/system.go | grep BODY | awk -F= '{print $2}' | sed 's/"//g')" >>$GITHUB_ENV
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '14'
- name: Build frontend with nodejs and yarn
run: |
cd UI
ls
yarn install
yarn build
- name: list work
run: pwd
- name: Build with xgo
uses: crazy-max/ghaction-xgo@v1
with:
xgo_version: v0.7.5
go_version: ${{ matrix.go_version }}
dest: build
prefix: casa
targets: linux/amd64,linux/arm64,linux/arm-7
v: true
x: false
race: false
ldflags: -s -w
buildmode: default
#
# - name: List Files
# run: |
# ls
# mkdir build
# ls
# echo "::set-output name=status::success"
- name: Pack builds
run: |
wget $PACK_SH_URL
chmod +x $PACK_SH
./$PACK_SH
echo "::set-output name=status::success"
- name: list work
run: ls
- name: Update release
uses: meeDamian/github-release@2.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
files: >
linux-amd64-casaos.tar.gz
linux-arm64-casaos.tar.gz
linux-arm-7-casaos.tar.gz
tag: v${{ env.VERSION }}
body: >
${{ env.BODY }}
name: v${{ env.VERSION }}
gzip: false
allow_override: false
prerelease: true
# - name: Upload linux-amd64-casaos.tar.gz
# id: upload_assets_amd64
# uses: shogo82148/actions-upload-release-asset@v1
# with:
# upload_url: ${{ steps.get_release.outputs.upload_url }}
# asset_path: /workdir/casa/upload/linux-amd64-casaos.tar.gz
#
# - name: Upload linux-arm64-casaos.tar.gz
# id: upload_assets_arm64
# uses: shogo82148/actions-upload-release-asset@v1
# with:
# upload_url: ${{ steps.get_release.outputs.upload_url }}
# asset_path: /workdir/casa/upload/linux-arm64-casaos.tar.gz