Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: lint bash files #20

Merged
merged 2 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
time: "08:00"
timezone: "America/New_York"
16 changes: 16 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: tizen-build-action lint
on:
push:
pull_request:

jobs:
bash-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Lint Bash
uses: azohra/shell-linter@latest
with:
path: '*.sh'
14 changes: 8 additions & 6 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/bash
#
# Set up Tizen Studio
#
Expand All @@ -6,7 +7,7 @@ INSTALLER="$GITHUB_WORKSPACE/tizen-studio_5.1.bin"

wget -nc -O "$INSTALLER" http://download.tizen.org/sdk/Installer/tizen-studio_5.1/web-cli_Tizen_Studio_5.1_ubuntu-64.bin
chmod a+x "$INSTALLER"
"$INSTALLER" --accept-license $TIZEN_STUDIO
"$INSTALLER" --accept-license "$TIZEN_STUDIO"

PATH="$TIZEN_STUDIO/tools/ide/bin:$PATH"

Expand All @@ -21,7 +22,7 @@ fi

PROJECT_DIR="$1"

if [ ! -z $2 ]; then
if [ -n "$2" ]; then
CUSTOM_AUTHOR_CERT="$GITHUB_WORKSPACE/author-cert.cer"
echo -n "$2" | base64 -d >"$CUSTOM_AUTHOR_CERT"
fi
Expand All @@ -33,14 +34,14 @@ echo -n "$3" | base64 -d >"$AUTHOR_KEY"

AUTHOR_PASSWORD="$4"

if [ ! -z $5 ]; then
if [ -n "$5" ]; then
CUSTOM_DISTRIBUTOR_CERT="$GITHUB_WORKSPACE/distributor-cert.cer"
echo -n "$5" | base64 -d >"$CUSTOM_DISTRIBUTOR_CERT"
fi
DEFAULT_DISTRIBUTOR_CERT="$TIZEN_STUDIO/tools/certificate-generator/certificates/distributor/sdk-$PRIVILEGE/tizen-distributor-ca.cer"
DISTRIBUTOR_CERT="${CUSTOM_DISTRIBUTOR_CERT:-"$DEFAULT_DISTRIBUTOR_CERT"}"

if [ ! -z $6 ]; then
if [ -n "$6" ]; then
CUSTOM_DISTRIBUTOR_KEY="$GITHUB_WORKSPACE/distributor-key.p12"
echo -n "$6" | base64 -d >"$CUSTOM_DISTRIBUTOR_KEY"
fi
Expand All @@ -49,7 +50,7 @@ DISTRIBUTOR_KEY="${CUSTOM_DISTRIBUTOR_KEY:-"$DEFAULT_DISTRIBUTOR_KEY"}"

DISTRIBUTOR_PASSWORD="${7:-tizenpkcs12passfordsigner}"

echo <<EOF
cat <<EOF
Build and signing parameters:
- project-dir: $PROJECT_DIR
- author-cert: $AUTHOR_CERT
Expand Down Expand Up @@ -86,9 +87,10 @@ ERROR_LOG="$GITHUB_WORKSPACE/tizen-studio-data/cli/logs/cli.log"
tizen build-web -- "$PROJECT_DIR" \
&& tizen package -t wgt -s sourcetoad-tizen-public -o "$PACKAGE_OUTPUT_PATH" -- "$PROJECT_DIR/.buildResult"

# shellcheck disable=SC2181
if [ $? -eq 0 ]; then
SUCCESS=true
echo "package-artifact=$PACKAGE_OUTPUT_PATH" >> $GITHUB_OUTPUT
echo "package-artifact=$PACKAGE_OUTPUT_PATH" >> "$GITHUB_OUTPUT"
else
SUCCESS=false
cat "$ERROR_LOG"
Expand Down