Skip to content

Commit 9252487

Browse files
authored
Merge pull request #5 from Cyber-Syntax/dev
fix: variable.sh notify and add github actions
2 parents 6eb7872 + 439f9c3 commit 9252487

File tree

5 files changed

+59
-17
lines changed

5 files changed

+59
-17
lines changed

.github/workflows/main.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: autorelease
2+
3+
on:
4+
push:
5+
branches: [ master, main ] # support both master and main branch names
6+
tags:
7+
- 'v*' # this will trigger on any tag that starts with 'v'
8+
9+
jobs:
10+
release:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v3 # updated to newer version
15+
with:
16+
fetch-depth: 0 # this ensures all tags and history are available
17+
18+
- name: create release
19+
uses: cupoftea696/gh-action-auto-release@v1.0.2 # updated to newer version
20+
with:
21+
title: "release: $version"
22+
tag: "v$semver"
23+
draft: false
24+
regex: "/^release: v?#{semver}$/i" # more flexible regex pattern
25+
prereleaseregex: "/^release: v?#{semver}-.*$/i"
26+
env:
27+
github_token: ${{ secrets.github_token }}

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
## v0.2.1-alpha
5+
### Changed
6+
- Add github action for release
7+
- refactor: variable.sh notify
8+
9+
## v0.2.0-alpha
10+
### Changed
11+
- fix: specific host options by @Cyber-Syntax in https://github.com/Cyber-Syntax/fedora-setup/pull/3
12+
- Add unit tests, improve logging, and enhance backup configurations by @Cyber-Syntax in https://github.com/Cyber-Syntax/fedora-setup/pull/4
13+
## v0.1.0-alpha
14+
### What's Changed
15+
- Feat/laptop desktop by @Cyber-Syntax in https://github.com/Cyber-Syntax/fedora-setup/pull/1
16+
- fix: wrong way to write grub file by @Cyber-Syntax in https://github.com/Cyber-Syntax/fedora-setup/pull/2
17+
- Initial setup script for Fedora

setup.sh

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,14 @@ source src/apps.sh
1717
source src/desktop.sh
1818
source src/laptop.sh
1919

20-
# Variable notifying the user that the script is running.
21-
if ! id "$USER" &>/dev/null; then
22-
log_warn "You forget to change variables according to your needs. Go src/variables.sh and change according to your needs."
23-
# Check if user forgot to change the VARIABLES.
24-
if [ -n "$SUDO_USER" ]; then
25-
whoami="$SUDO_USER"
26-
else
27-
whoami=$(whoami)
28-
fi
29-
30-
log_warn "Script USER variable is: $USER but your username: $whoami."
31-
log_warn "Please change the USER variable and other variables according to your system configuration."
32-
20+
echo "=================================================="
21+
echo "important: this script uses configuration values from src/variables.sh"
22+
echo "please ensure you've reviewed and adjusted these values for your system."
23+
echo "=================================================="
24+
#TODO: better way to check and notify user to prevent variable errors.
25+
read -p "Have you reviewed src/variables.sh? (y/n): " user_confirmed
26+
if [[ "${user_confirmed,,}" != "y" ]]; then
27+
log_warn "Please review src/variables.sh before running this script."
3328
exit 1
3429
fi
3530

@@ -428,8 +423,6 @@ main() {
428423
if [[ "$system_type" == "laptop" ]]; then
429424
log_info "Executing laptop-specific functions..."
430425
laptop_hostname_change
431-
#TEST: Currently on laptop but can be used on globally when desktop switch lightdm
432-
nopasswdlogin_group
433426
tlp_setup
434427
thinkfan_setup
435428
touchpad_setup
@@ -450,6 +443,7 @@ main() {
450443
setup_files "$system_type"
451444
switch_ufw_setup
452445

446+
nopasswdlogin_group
453447
# services
454448
syncthing_setup
455449
trash_cli_setup

src/packages.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,5 @@ FLATPAK_PACKAGES=(
9494
# Proprietary softwares
9595
md.obsidian.Obsidian
9696
com.spotify.Client
97+
com.zed.Zed # Zed editor
9798
)

src/variables.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
#!/usr/bin/env bash
22

3+
4+
5+
USER=$(whoami) # automatically detect current user
36
# User-specific variables
4-
# WARN: Change these variables as needed.
5-
USER="developer"
7+
# WARN: Change these variables as needed
8+
# WARNING: Comment out the line below if you want to use the detected user.
69
SESSION="qtile"
710
LAPTOP_IP="192.168.1.54"
811

0 commit comments

Comments
 (0)