-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from moritztim/remote
reorganize to support run & build scripts
- Loading branch information
Showing
7 changed files
with
80 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Build script and attach to release | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
build-and-attach: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
||
- name: Build script | ||
run: ./build.sh > /tmp/nixos-kexec.sh | ||
|
||
- name: Checksum | ||
run: sha1sum /tmp/nixos-kexec.sh > /tmp/nixos-kexec.sh.sha1 | ||
|
||
- name: Attach to release | ||
uses: csexton/release-asset-action@v3 | ||
with: | ||
pattern: /tmp/nixos-kexec.sh* | ||
github-token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
# Outputs a fully built script to be piped to bash, saved to a file, etc. | ||
|
||
SOURCE="./src" | ||
DEFAULT_CONFIGURATION_FILE="$SOURCE/default.env" | ||
|
||
set -o pipefail -o errexit | ||
|
||
cd "$(dirname "$0")" | ||
|
||
echo "#! /usr/bin/env bash" | ||
echo "# This script is GENERATED. Do not edit directly." | ||
echo | ||
cat "$DEFAULT_CONFIGURATION_FILE" | ||
cat "$SOURCE/read_config.sh" | ||
cat "$SOURCE/nixos_kexec.sh" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env bash | ||
SOURCE="./src" | ||
DEFAULT_CONFIGURATION_FILE="$SOURCE/default.env" | ||
|
||
set -o pipefail -o errexit | ||
|
||
cd "$(dirname "$0")" | ||
|
||
source "$SOURCE/read_config.sh" | ||
source "$SOURCE/nixos_kexec.sh" "$@" |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
# Function to read config file | ||
# Adapted from: https://stackoverflow.com/a/30969768/179329 | ||
read_config() { | ||
set -o allexport && source "$1" && set +o allexport | ||
} |