Skip to content

Commit

Permalink
include example gopherhole
Browse files Browse the repository at this point in the history
  • Loading branch information
someodd committed Oct 7, 2024
1 parent 97f4f96 commit cee22fb
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 68 deletions.
97 changes: 31 additions & 66 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,74 +31,39 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup Haskell
uses: haskell-actions/setup@v2
with:
ghc-version: '9.6.6'
enable-stack: 'true'
stack-version: 'latest'

# Cache GHC installations (programs)
- name: Cache GHC installations
uses: actions/cache@v3
with:
path: ~/.stack/programs
key: ${{ runner.os }}-ghc-${{ hashFiles('**/stack.yaml.lock') }}
restore-keys: |
${{ runner.os }}-ghc-
# Cache Stack binary
- name: Cache Stack binary
uses: actions/cache@v3
with:
path: ~/.local/bin/stack
key: ${{ runner.os }}-stack-bin-${{ hashFiles('**/stack.yaml.lock') }}
restore-keys: |
${{ runner.os }}-stack-bin-
# Cache Stack packages (dependencies)
- name: Cache Stack packages
uses: actions/cache@v3
with:
path: ~/.stack
key: ${{ runner.os }}-stack-${{ hashFiles('**/stack.yaml.lock') }}
restore-keys: |
${{ runner.os }}-stack-
- uses: actions/checkout@v4

- name: Cache Ruby gems
uses: actions/cache@v3
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Setup Haskell
uses: haskell-actions/setup@v2
with:
ghc-version: '9.6.6'
enable-stack: 'true'
stack-version: 'latest'

- name: Cache fpm
uses: actions/cache@v3
with:
path: /usr/local/bundle
key: ${{ runner.os }}-fpm-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-fpm-
- name: Cache Stack dependencies
uses: actions/cache@v3
with:
path: |
~/.stack
!~/.stack/programs
./.stack-work
key: ${{ runner.os }}-stack-${{ hashFiles('stack.yaml', 'package.yaml') }}

- name: Install fpm
if: steps.cache_fpm.outputs.cache-hit != 'true'
run: |
sudo apt-get update
sudo apt-get install -y ruby ruby-dev rubygems build-essential
sudo gem install --no-document fpm
- name: Install fpm
run: |
sudo apt-get update
sudo apt-get install -y ruby ruby-dev rubygems build-essential
sudo gem install --no-document fpm
- name: Build and Package
id: build_package
run: |
chmod +x ./reposcripts/package.sh
PACKAGE_PATH=$(./reposcripts/package.sh | tail -n1)
echo "package_path=$PACKAGE_PATH" >> $GITHUB_OUTPUT
echo "Package path: $PACKAGE_PATH"
- name: Build and Package
id: build_package
run: |
chmod +x ./reposcripts/package.sh
PACKAGE_PATH=$(./reposcripts/package.sh | tail -n1)
echo "package_path=$PACKAGE_PATH" >> $GITHUB_OUTPUT
echo "Package path: $PACKAGE_PATH"
- name: Upload Release Asset
uses: softprops/action-gh-release@v1
with:
files: ${{ steps.build_package.outputs.package_path }}
- name: Upload Release Asset
uses: softprops/action-gh-release@v1
with:
files: ${{ steps.build_package.outputs.package_path }}
5 changes: 3 additions & 2 deletions reposcripts/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@ stack build --copy-bins --local-bin-path ./bin
mkdir -p $TEMPORARY_PKG_DIR/usr/local/bin
mkdir -p $TEMPORARY_PKG_DIR/etc/systemd/system
mkdir -p $TEMPORARY_PKG_DIR/var/gopher/output
mkdir -p $TEMPORARY_PKG_DIR/var/gopher/source

# Copy the built binary to the temporary package directory
cp ./bin/bore $TEMPORARY_PKG_DIR/usr/local/bin/bore
# Copy the systemd service file to the temporary package directory
cp ./reposcripts/bore.service $TEMPORARY_PKG_DIR/etc/systemd/system/bore.service
# Copy this for the daemon
# Copy the example gopherhole to the temporary package directory
cp -r ./example $TEMPORARY_PKG_DIR/var/gopher/source
# Copy this/overwrite for the daemon
cp ./reposcripts/bore.toml $TEMPORARY_PKG_DIR/var/gopher/source/bore.toml

# Run fpm to create the Debian package.
Expand Down

0 comments on commit cee22fb

Please sign in to comment.