diff --git a/.github/workflows/version.yml b/.github/workflows/version.yml new file mode 100644 index 0000000..fab5806 --- /dev/null +++ b/.github/workflows/version.yml @@ -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 diff --git a/.gitignore b/.gitignore index 8b13789..b5e4599 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ - +setup.conf diff --git a/archcrystal.sh b/archcrystal.sh index d0396ff..b4c573a 100644 --- a/archcrystal.sh +++ b/archcrystal.sh @@ -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)" diff --git a/package.json b/package.json new file mode 100644 index 0000000..1a04a1b --- /dev/null +++ b/package.json @@ -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" +} diff --git a/scripts/2-user.sh b/scripts/2-user.sh index b8cf1b9..6e84a7e 100755 --- a/scripts/2-user.sh +++ b/scripts/2-user.sh @@ -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}" diff --git a/setup.conf b/setup.conf.example similarity index 59% rename from setup.conf rename to setup.conf.example index 199fa80..080a8d8 100644 --- a/setup.conf +++ b/setup.conf.example @@ -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=