Skip to content

Commit

Permalink
Merge pull request #3 from aldochaconc/feat/repo-config
Browse files Browse the repository at this point in the history
Feat/repo config
  • Loading branch information
aldochaconc authored Jan 28, 2024
2 parents 87d03f0 + 5d30b15 commit f69c48d
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 6 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Create version tag

on:
push:
branches:
- main
env:
TAG_VERSION: v0.0.0
PREVIOUS_TAG: 0.0.0
LATEST_TAG: 0.0.0
SHELL_SCRIPT_VERSION: 0.0.0
jobs:
create_tag:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Check the latest version
run: |
all_tags=$(git tag | sort -rV)
read -ra all_tags_vector <<< "$all_tags"
latest_tag_version="${all_tags_vector[0]#v}"
shell_script_version=$(grep -i -E '^# version\s*=\s*"[0-9]+\.[0-9]+\.[0-9]+"' archcrystal.sh | \
grep -o -E '[0-9]+\.[0-9]+\.[0-9]+')
echo "SHELL_SCRIPT_VERSION=${shell_script_version}" >> $GITHUB_ENV
function version { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; }
if [ $(shell_script_version#v) -ge $(latest_tag_version) ]; then
echo "NEW_TAG_FLAG='1'" >> $GITHUB_ENV
echo "::set-output name=tag-created::1"
fi
- uses: butlerlogic/action-autotag@1.1.2
if: ${{ env.NEW_TAG_FLAG != '0' }}
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
with:
strategy: regex
root: archcrystal.sh
regex_pattern: $SHELL_SCRIPT_VERSION
tag_prefix: v
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@

setup.conf
2 changes: 2 additions & 0 deletions archcrystal.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/bash
# Script Name: archcrystal.sh
# Version: 1.0.0

set -a
BASE_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
Expand Down
23 changes: 23 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "archcrystal",
"version": "1.0.0",
"description": "Automated archlinux installation",
"main": "",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/aldochaconc/archcrystal.git"
},
"keywords": [
"archlinux",
"shell"
],
"author": "Aldo W.",
"license": "ISC",
"bugs": {
"url": "https://github.com/aldochaconc/archcrystal/issues"
},
"homepage": "https://github.com/aldochaconc/archcrystal#readme"
}
1 change: 0 additions & 1 deletion scripts/2-user.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ cd ~
git clone "https://aur.archlinux.org/yay.git"
cd ~/yay
makepkg -si --noconfirm
# sed $INSTALL_TYPE is using install type to check for MINIMAL installation, if it's true, stop
# stop the script and move on, not installing any more packages below that line
while read line; do
echo "INSTALLING: ${line}"
Expand Down
6 changes: 2 additions & 4 deletions setup.conf → setup.conf.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@ TIMEZONE=America/Santiago
KEYMAP=us
MOUNT_OPTIONS=noatime,compress=zstd,ssd,commit=120
DISK=/dev/sda
USERNAME=crystal
NAME_OF_MACHINE=moon
AUR_HELPER=yay
INSTALL_TYPE=MINIMAL
USERNAME=
NAME_OF_MACHINE=

0 comments on commit f69c48d

Please sign in to comment.