Skip to content

Commit

Permalink
Github Actions introduced (#4)
Browse files Browse the repository at this point in the history
Github Actions workflow added with script to auto generate it.
  • Loading branch information
wiktor2200 authored Jul 30, 2022
1 parent 5aea253 commit 107d625
Show file tree
Hide file tree
Showing 13 changed files with 498 additions and 12 deletions.
426 changes: 426 additions & 0 deletions .github/workflows/bash-tests.yml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Develop/feature_list.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
2021-11-12
2022-07-30

|Task|Description|Subscript|
|---|---|---|
Expand Down
27 changes: 27 additions & 0 deletions Develop/generate-script-from-config.bash
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
# CREATED: 2018-06-12
#===============================================================================

UBUNTU_VERSION="20.04"

# Get script's main directory
DIR=`dirname $0`

Expand Down Expand Up @@ -107,6 +109,30 @@ function generate_summary () {
fi"
}

function generate_github_actions () {
cat $DIR/description.txt | sed "s/CURRENT_DATE/`date +%F`/g"
echo -e "name: Check Bash scripts"
echo -e "on: [pull_request]\n"
echo -e "jobs:"

# Read config file from main script directory
INPUT="$DIR/config.csv"
IFS=':'

# Read config from CSV file
[ ! -f $INPUT ] && { echo "$INPUT File not found"; exit 99; }
while read state task description script
do
echo -e " $script:"
echo -e " runs-on: ubuntu-$UBUNTU_VERSION"
echo -e " steps:"
echo -e " - uses: actions/checkout@v3"
echo -e " - name: Run $script"
echo -e " run: sudo apt-get update; sudo bash ./scripts/$script"
done < $INPUT
unset IFS
}

# Generate Markdown features table
function generate_markdown_feature_table () {
# Read config file from main script directory
Expand All @@ -131,4 +157,5 @@ generate_zenity_menu >> $DIR/../ubuntu-firstrun-config.bash
generate_case >> $DIR/../ubuntu-firstrun-config.bash
generate_summary >> $DIR/../ubuntu-firstrun-config.bash
generate_markdown_feature_table > $DIR/feature_list.md
generate_github_actions > $DIR/../.github/workflows/bash-tests.yml
echo "Done!"
1 change: 1 addition & 0 deletions scripts/enable-upgrade-notifications
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# Set upgrade notifications for all users

# Add update notifier to desktop entries
mkdir -p ~/.config/autostart
echo -e "[Desktop Entry]\n\
Name=Update Notifier\n\
Comment=Check for available updates automatically\n\
Expand Down
1 change: 1 addition & 0 deletions scripts/install-amd-nvidia-drivers
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
# Utilties - Install AMD-Nvidia graphics drivers
# Install Install AMD-Nvidia graphics drivers

sudo apt install ubuntu-drivers-common
sudo ubuntu-drivers autoinstall
17 changes: 9 additions & 8 deletions scripts/install-dropbox
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -

# Add Dropbox to user's environment autostart (with Gnome panel icon fix)
mkdir -p ~/.config/autostart
echo -e "[Desktop Entry]\n\
Type=Application\n\
Name=Dropbox\n\
Expand All @@ -18,12 +19,12 @@ Hidden=false\n\
NoDisplay=false\n\
Comment=Start Dropbox at log in" | tee ~/.config/autostart/dropbox.desktop > /dev/null

# Add Dropbox python CLI script
mkdir ~/.local/bin
cd ~/.local/bin/ && wget "https://linux.dropbox.com/packages/dropbox.py"
chmod +x dropbox.py
ln -s dropbox.py dropbox
# # Add Dropbox python CLI script
# mkdir ~/.local/bin
# cd ~/.local/bin/ && wget "https://linux.dropbox.com/packages/dropbox.py"
# chmod +x dropbox.py
# ln -s dropbox.py dropbox

# Firstrun dropbox daemon and then kill it to not freeze configuration script
~/.dropbox-dist/dropboxd & sleep 10
killall dropbox*
# # Firstrun dropbox daemon and then kill it to not freeze configuration script
# ~/.dropbox-dist/dropboxd & sleep 10
# killall dropbox*
14 changes: 13 additions & 1 deletion scripts/install-language-packages
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,17 @@

# Get system language (locale)
SYS_LANGUAGE=`locale | grep LANG | cut -d= -f2 | cut -d_ -f1`
SYS_LANGUAGE2=$SYS_LANGUAGE

sudo apt install -y aspell-$SYS_LANGUAGE firefox-locale-$SYS_LANGUAGE hyphen-$SYS_LANGUAGE language-pack-gnome-$SYS_LANGUAGE language-pack-gnome-$SYS_LANGUAGE-base language-pack-$SYS_LANGUAGE language-pack-$SYS_LANGUAGE-base libreoffice-help-$SYS_LANGUAGE libreoffice-l10n-$SYS_LANGUAGE manpages-$SYS_LANGUAGE myspell-$SYS_LANGUAGE mythes-$SYS_LANGUAGE wpolish
## Solve problem when locale is not set at all
if [[ $SYS_LANGUAGE == "C.UTF-8" ]] ; then
SYS_LANGUAGE="en"
SYS_LANGUAGE2="en-us"
fi

sudo apt install -y aspell-$SYS_LANGUAGE firefox-locale-$SYS_LANGUAGE language-pack-gnome-$SYS_LANGUAGE language-pack-gnome-$SYS_LANGUAGE-base language-pack-$SYS_LANGUAGE language-pack-$SYS_LANGUAGE-base wpolish
sudo apt install -y hyphen-$SYS_LANGUAGE2 libreoffice-help-$SYS_LANGUAGE2 libreoffice-l10n-$SYS_LANGUAGE2 mythes-$SYS_LANGUAGE2

if [[ ! $SYS_LANGUAGE == "en" ]] ; then
sudo apt install manpages-$SYS_LANGUAGE
fi
5 changes: 5 additions & 0 deletions scripts/install-libreoffice
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,9 @@
# Get system language (locale)
SYS_LANGUAGE=`locale | grep LANG | cut -d= -f2 | cut -d_ -f1`

## Solve problem when locale is not set at all
if [[ $SYS_LANGUAGE == "C.UTF-8" ]] ; then
SYS_LANGUAGE="en-us"
fi

sudo apt install -y libreoffice-calc libreoffice-draw libreoffice-gnome libreoffice-help-$SYS_LANGUAGE libreoffice-impress libreoffice-java-common libreoffice-l10n-$SYS_LANGUAGE libreoffice-l10n-en-gb libreoffice-math libreoffice-ogltrans libreoffice-pdfimport libreoffice-style-breeze libreoffice-writer
1 change: 1 addition & 0 deletions scripts/install-taskcoach
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ else
fi

## Integrate TaskCoach AppImage with desktop
mkdir -p /home/$USER/.local/share/applications
echo -e "[Desktop Entry]\n\
Type=Application\n\
Name=Task Coach\n\
Expand Down
5 changes: 5 additions & 0 deletions scripts/install-thunderbird
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,9 @@
# Get system language (locale)
SYS_LANGUAGE=`locale | grep LANG | cut -d= -f2 | cut -d_ -f1`

## Solve problem when locale is not set at all
if [[ $SYS_LANGUAGE == "C.UTF-8" ]] ; then
SYS_LANGUAGE="en"
fi

sudo apt install -y thunderbird thunderbird-gnome-support thunderbird-locale-en thunderbird-locale-$SYS_LANGUAGE
4 changes: 3 additions & 1 deletion scripts/install-vlc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

sudo apt install -y vlc

# Set as default media player
# Set as default Gnome media player
sudo mkdir -p /etc/gnome
sudo touch /etc/gnome/defaults.list
sudo sed -i 's/org.gnome.Totem.desktop/vlc.desktop/g' /etc/gnome/defaults.list
sudo sed -i 's/rhythmbox.desktop/vlc.desktop/g' /etc/gnome/defaults.list
5 changes: 5 additions & 0 deletions scripts/uninstall-garbage-packages
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ sudo apt remove -y --purge aisleriot branding-ubuntu cheese deja-dup example-con
# Get system language (locale)
SYS_LANGUAGE=`locale | grep LANG | cut -d= -f2 | cut -d_ -f1`

## Solve problem when locale is not set at all
if [[ $SYS_LANGUAGE == "C.UTF-8" ]] ; then
SYS_LANGUAGE="en"
fi

# uninstall non-english language packages
sudo apt remove --purge -y `dpkg-query -W --showformat='${Package}\n' | grep language-pack | egrep -v '\-en' | egrep -v "$SYS_LANGUAGE"`
sudo apt remove --purge -y `dpkg-query -W --showformat='${Package}\n' | grep firefox-locale | egrep -v '\-en' | egrep -v "$SYS_LANGUAGE"`
Expand Down
2 changes: 1 addition & 1 deletion ubuntu-firstrun-config.bash
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# AUTHOR: wiktor2200, https://github.com/wiktor2200
# REPO: https://github.com/wiktor2200/Ubuntu-firstrun-config
# CREATED: 2018-06-12
# UPDATED: 2021-11-12
# UPDATED: 2022-07-30
#===============================================================================
# This script is generated using: generate-script-from-config.bash from repo: https://github.com/wiktor2200/Ubuntu-firstrun-config

Expand Down

0 comments on commit 107d625

Please sign in to comment.