Skip to content

Commit

Permalink
feat: Prepare release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziwi01 committed Mar 15, 2023
1 parent 0993b2c commit ddb7425
Show file tree
Hide file tree
Showing 7 changed files with 97 additions and 41 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/ci.yml → .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
name: Ubuntu build
name: "pre-release"

on:
push:
branches: [ master ]

branches:
- "master"
workflow_dispatch:

jobs:
ubuntu-22:
pre-release:
name: "Pre Release"
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3

Expand All @@ -22,3 +24,10 @@ jobs:
- name: Setup environment
working-directory: ./ansible
run: ansible-playbook -i inventory.yml setup-ubuntu.yml

- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: true
title: "Pre-release Build"
35 changes: 35 additions & 0 deletions .latest-versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
github_packages:
neovim: latest
lunarvim: master
diff_so_fancy: latest
bat: latest
zoxide: latest
helm: latest
lazygit: latest
fzf: latest
tmux: latest
ripgrep: latest
fd: latest
kind: latest
k9s: latest
yq: latest
win32yank: latest
git_fuzzy: latest
nvm: latest
tpm: latest
pes: latest
p10k: latest
git_apt_version: latest
pip_packages:
gita: latest
thefuck: latest
docker_apt_packages:
docker-ce: latest
docker-ce-cli: latest
containerd.io: latest
docker-compose-plugin: latest
kubectl_version: latest
ansible_pip_version: latest
ansible_lint_pip_version: latest
puppet_pdk_version: latest
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ Please read below README carefully and go through the scripts to see whats going
* [Puppet](#puppet)
* [Ansible](#ansible)
* [Rust](#rust)
* [Releases](#releases)
* [Requirements](#requirements)
* [Windows setup](#windows-setup)
* [Manual](#manual)
Expand All @@ -70,7 +71,6 @@ Please read below README carefully and go through the scripts to see whats going
* [Excluding code](#excluding-code)
* [Run particular code](#run-particular-code)
* [Ansible tags](#ansible-tags)
* [Releases](#releases)
* [Troubleshooting](#troubleshooting)
* [Github tasks issues](#github-tasks-issues)
* [VPN connectivity issues](#vpn-connectivity-issues)
Expand Down Expand Up @@ -234,6 +234,14 @@ To configure linter diagnostics (enable/disable some checks) in LunarVIM for Ans

As LunarVIM requires it, [Rust](https://www.rust-lang.org/) is installed with [Cargo](https://github.com/rust-lang/cargo/) package manager.

## Releases

- `develop` branch - most of the software/plugins are set to `latest`. It contains all recent changes/features **and** sometimes in-progress testing features. Also documentation updates and so on.
- `master` branch contains rather stable updates from develop (documentation, new tested plugins, fixes), but all of the software versions are fixed.
- tagged releases are done from time to time whenever some useful functionality comes up (or critical fixes).

I recommend using `master` branch, with some of the software versions overwritten in `ansible/vars/overrides.yml` to be set to `latest`. See `.latest-versions.yml` to see what is set on `develop`.

## Requirements

When using either plain Ubuntu or WSL2:
Expand Down Expand Up @@ -598,12 +606,6 @@ For particular functionality:
- zoxide
- zsh

## Releases

Using `master` branch comes with certain amount of danger, as most of the tools used are set to `latest` version. This can cause issues, when those underlying tools introduce a breaking change. Moreover, as I personally try very hard not to make any breaking changes, it can always happen. If you want more stability, please checkout to a release tag before applying the changes - it will have fixed versions of (almost) all used tools.

I will try push new releases with updated (tested) software versions once in a while (even when there is no change to the automation itself), but you can set them yourself - see [Versions management](#versions-management)

## Troubleshooting

See below known issues and solutions.
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/config/files/lvim-config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ lvim.plugins = {
"f-person/git-blame.nvim",
event = "BufRead",
config = function()
vim.cmd "highlight default link gitblame SpecialComment"
vim.cmd("highlight default link gitblame SpecialComment")
vim.g.gitblame_enabled = 0
end,
},
Expand Down
37 changes: 11 additions & 26 deletions ansible/roles/software/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
# This is array of tasks to exclude from software role.
# For list of tasks see: software/tasks/main.yml or see README.md
software_tasks_exclude: []

# System manager to use. Ansible has issues detecting SysV vs. SystemD on WSL distributions
# If you are using SysVInit WSL (not recommended, see `README.md`), overwrite this in `ansible/vars/overrides.yml` to `sysvinit`
service_manager: systemd

# Default packages to be installed first, using APT
# There is no version here as those are Ubuntu distro defaults always
default_apt_packages:
Expand All @@ -27,7 +25,6 @@ default_apt_packages:
- libevent-dev # v Required for latest Tmux install
- universal-ctags # v Required for latest Tmux install
- ncurses-dev # v Required for latest Tmux install

# Specific versions for software (github)
# Fixed versions should be set without `v` prefix (e.g: 1.4.3)
github_packages:
Expand All @@ -52,26 +49,20 @@ github_packages:
pes: latest # Puppet Editor Services. They don't release anymore, so latest means latest commit
p10k: latest
rvm1_ansible: 2.2.0 # Version of https://github.com/rvm/rvm1-ansible

# Kubectl version
kubectl_version: latest

# Packages and their versions to install with PIP
pip_packages:
thefuck: latest
thefuck: "latest"
gita: latest

# FZF
fzf_git_url: "https://github.com/junegunn/fzf.git"
fzf_home: "{{ ansible_env.HOME }}/.fzf"

# Git from custom PPA repo
git_apt_version: latest

# GIT Fuzzy
git_fuzzy_url: "https://github.com/bigH/git-fuzzy.git"
git_fuzzy_home: "{{ ansible_env.HOME }}/.local/opt/git-fuzzy"

# Oh-My-Zsh
omz_home: "{{ ansible_env.HOME }}/.oh-my-zsh"
omz_plugins:
Expand All @@ -84,29 +75,24 @@ omz_plugins:
zsh-lazyload: https://github.com/qoomon/zsh-lazyload
pyenv-lazy: https://github.com/davidparsson/zsh-pyenv-lazy.git
zsh-snv: https://github.com/rpeshkov/zsh-snv

# TMUX Plugin Manager
tmux_plugins_dir: "{{ ansible_env.HOME }}/.tmux/plugins"
tpm_git_url: https://github.com/tmux-plugins/tpm.git

# Docker system dependency packages
docker_apt_dependencies:
- ca-certificates
- gnupg
- lsb-release

# Docker main packages from APT repo
docker_apt_packages:
docker-ce: latest
docker-ce-cli: latest
containerd.io: latest
docker-compose-plugin: latest

# RVM / Ruby
rvm1_rubies:
- ruby-3.1.3
rvm1_user: "{{ ansible_user_id }}"

# Ruby
# Install any gem for any ruby. `all` installs for all of them
# Note that if Puppet is installed, it will install puppet/puppet-lint gems, so no need to add here.
Expand All @@ -116,7 +102,6 @@ ruby_gems:
- ruby: all
gems:
- neovim: 0.9.0

# Puppet
puppet_version: 7.21.0
puppet_lint_version: 3.0.1
Expand All @@ -130,21 +115,16 @@ puppet_rubies:
# PDK (Puppet Development KIT)
# Please note the module does not support package downgrades - if PDK is already installed in higher version, remove it first.
puppet_pdk_version: latest

# Node
node_version: 'lts/gallium'

# Ansible
ansible_pip_version: latest
ansible_lint_pip_version: latest

# LunarVIM
lunarvim_url: https://github.com/lunarvim/lunarvim.git
lunarvim_home: "{{ ansible_env.HOME }}/.local/opt/lunarvim"

# Puppet
puppet_pes_url: https://github.com/puppetlabs/puppet-editor-services.git

# SDK Man
sdkman_update: true
sdkman_user: "{{ ansible_user_id }}"
Expand All @@ -154,11 +134,16 @@ sdkman_dir: "{{ sdkman_user_home_dir + '/.sdkman' }}"
sdkman_tmp_dir: /tmp
sdkman_validate_ssl: true
sdkman_install_packages:
- { candidate: java, version: '18.0.2-open' }
- { candidate: java, version: '11.0.12-open' }
- { candidate: gradle, version: '7.5.1' }
- { candidate: groovy, version: '4.0.4' }
- { candidate: maven, version: '3.9.0' }
- candidate: java
version: 18.0.2-open
- candidate: java
version: 11.0.12-open
- candidate: gradle
version: 7.5.1
- candidate: groovy
version: 4.0.4
- candidate: maven
version: 3.9.0
sdkman_uninstall_packages: []
# sdkman_uninstall_packages:
# - { candidate: java, version: 6u45 }
Expand Down
3 changes: 0 additions & 3 deletions ansible/setup-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
All above versions are added/updated in `{{ playbook_dir }}/../current-versions.yml`
See `README.md` for details on versioning.
Release:
yq eval-all '. as $item ireduce ({}; . * $item)' ansible/roles/software/vars/main.yml current-versions.yml
tasks:
- name: '[Init] Check sudo password'
ansible.builtin.command: echo "sudo password is correct"
Expand Down
28 changes: 28 additions & 0 deletions publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

# Publish changes to master branch
#
# 1. Copy currently used versions from current-versions.yml to `ansible/roles/software/vars/main.yml`
# 2. (?) Generate changelog in Changes.md
# 3. Commit, push
# 4. Merge to master
# 5. Get back latest versions from `.latest-versions.yml` to software vars.

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

yq -i eval-all '. as $item ireduce ({}; . * $item)' ${SCRIPT_DIR}/ansible/roles/software/vars/main.yml ${SCRIPT_DIR}/current-versions.yml

git add .
git commit -a -m 'release: Publish changes to master'
git push
git checkout master
git pull
git merge develop
git push
git checkout develop

yq -i eval-all '. as $item ireduce ({}; . * $item)' ${SCRIPT_DIR}/.latest-versions.yml ${SCRIPT_DIR}/ansible/roles/software/vars/main.yml

git add .
git commit -a -m 'release: Set latest version for development'
git push

0 comments on commit ddb7425

Please sign in to comment.