Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2
updates:
# Enable version updates for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "monday"
time: "08:00"
open-pull-requests-limit: 5
commit-message:
prefix: "ci"
include: "scope"
75 changes: 75 additions & 0 deletions .github/workflows/package-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: package-build
on:
pull_request:
push:
tags:
- 'v*'
permissions:
actions: read
contents: read
pull-requests: write
concurrency:
group: "${{ github.ref }}"
cancel-in-progress: true
jobs:
build-debian:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: "Update changelog"
run: |
set -ex
OLD_VERSION=$(dpkg-parsechangelog -SVersion)
SOURCE=$(dpkg-parsechangelog -SSource)
if [[ "${{ github.ref_type }}" == "tag" ]]; then
VERSION_SUFFIX="+gh"
else
VERSION_SUFFIX="+autobuild${GITHUB_RUN_NUMBER}"
fi
cat > debian/changelog <<EOT
${SOURCE} (${OLD_VERSION}${VERSION_SUFFIX}) UNRELEASED; urgency=medium

* Automated Build

-- Automated Build <builder@localhost> $(date -R)
EOT
- uses: jtdor/build-deb-action@v1
- name: Archive build result
uses: actions/upload-artifact@v4
with:
name: packages
if-no-files-found: error
retention-days: 14
path: |
debian/artifacts/*.deb
debian/artifacts/*.tar.*
- name: Comment PR with artifact link
if: github.event_name == 'pull_request'
uses: actions/github-script@v8
with:
script: |
const runId = context.runId;
const repoOwner = context.repo.owner;
const repoName = context.repo.repo;

// Get the artifact download URL
const artifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: repoOwner,
repo: repoName,
run_id: runId
});

const packagesArtifact = artifacts.data.artifacts.find(artifact => artifact.name === 'packages');
if (!packagesArtifact) {
console.log('No packages artifact found');
return;
}

const artifactUrl = `https://github.com/${repoOwner}/${repoName}/actions/runs/${runId}/artifacts/${packagesArtifact.id}`;

github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `📦 Built packages are ready! [Download here](${artifactUrl}).`
});
101 changes: 101 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: release
on:
push:
tags:
- 'v*'

jobs:
create-release:
runs-on: ubuntu-latest
permissions:
actions: read
contents: write
steps:
- uses: actions/checkout@v5

- name: Extract version from tag
id: version
run: |
TAG_NAME="${GITHUB_REF#refs/tags/}"
VERSION="${TAG_NAME#v}"
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
echo "tag=${TAG_NAME}" >> "$GITHUB_OUTPUT"

- name: Extract changelog entry
id: changelog
run: |
VERSION="${{ steps.version.outputs.version }}"

# Extract and clean changelog for this specific version
CHANGES=$(dpkg-parsechangelog -l debian/changelog --since "${VERSION}" --until "${VERSION}" --show-field Changes | \
sed '/^[a-zA-Z0-9-].*([^)]*)[[:space:]]*.*$/d' | \
sed 's/^[[:space:]]*\.[[:space:]]*$//' | \
sed '/^[[:space:]]*$/d' | \
sed 's/^[[:space:]]*\*[[:space:]]*/- /' | \
sed 's/^[[:space:]]*\\+[[:space:]]*/ - /')

# Set as output for use in release
{
echo 'description<<EOF'
echo "$CHANGES"
echo 'EOF'
} >> "$GITHUB_OUTPUT"

- name: Wait for and get package build run ID
id: build-run
uses: actions/github-script@v8
with:
script: |
const maxWaitTime = 10 * 60 * 1000; // 10 minutes
const pollInterval = 30 * 1000; // 30 seconds
const startTime = Date.now();

while (Date.now() - startTime < maxWaitTime) {
const runs = await github.rest.actions.listWorkflowRuns({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'package-build.yml',
head_sha: context.sha,
status: 'completed',
conclusion: 'success'
});

if (runs.data.workflow_runs.length > 0) {
const runId = runs.data.workflow_runs[0].id;
console.log(`Found successful package-build run: ${runId}`);
return runId;
}

console.log('Package-build workflow not completed yet, waiting...');
await new Promise(resolve => setTimeout(resolve, pollInterval));
}

throw new Error('Package-build workflow did not complete successfully within 10 minutes');

- name: Download build artifacts
uses: actions/download-artifact@v5
with:
name: packages
path: artifacts/
run-id: ${{ steps.build-run.outputs.result }}
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Create GitHub Release
run: |
DEB_FILE=$(find artifacts -name "*.deb" -printf "%f\n" | head -1)
gh release create "${{ steps.version.outputs.tag }}" \
--title "Release ${{ steps.version.outputs.tag }}" \
--notes "## Changes in ${{ steps.version.outputs.version }}

${{ steps.changelog.outputs.description }}

---

📦 **Installation:**
Download the package and install with:
\`\`\`bash
sudo apt install ./${DEB_FILE}
\`\`\`" \
artifacts/*
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33 changes: 0 additions & 33 deletions .github/workflows/test-build.yml

This file was deleted.

49 changes: 49 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# grml-paste

[![Sponsor](https://img.shields.io/badge/Sponsor-GitHub-purple?logo=github)](https://github.com/sponsors/grml)
[![GitHub release](https://img.shields.io/github/v/release/grml/grml-paste)](https://github.com/grml/grml-paste/releases)
[![Debian package](https://img.shields.io/debian/v/grml-paste/trixie?label=debian)](https://packages.debian.org/trixie/grml-paste)
[![Ubuntu package](https://img.shields.io/ubuntu/v/grml-paste)](https://packages.ubuntu.com/search?keywords=grml-paste)

Paste text into a pastebin service

## Overview

grml-paste is a client for a pastebin service like https://paste.debian.net/.

## Installation

### From Debian repositories

```bash
sudo apt install grml-paste
```

Package information: [grml-paste on packages.debian.org](https://packages.debian.org/trixie/grml-paste)

### From GitHub releases

Download the latest `.deb` package from the [releases page](../../releases) and install:

```bash
sudo apt install ./grml-paste_*.deb
```

## Quick start

1. Install the package (see above)
2. Paste some text:
```bash
echo hi | grml-paste
```

## License

This project is licensed under the GPL v2+.

## Contributing

- **Source code**: https://github.com/grml/grml-paste
- **Issues**: https://github.com/grml/grml-paste/issues
- **Releases**: https://github.com/grml/grml-paste/releases
- **Grml Live Linux**: https://grml.org
2 changes: 1 addition & 1 deletion grml-paste
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/python3
# Filename: grml-paste
# Purpose: XmlRpc interface client to paste.grml.org
# Purpose: XmlRpc Pastebin interface client
# Author: Michael Gebetsroither <gebi@grml.org>
# License: This file is licensed under the GPL v2.
################################################################################
Expand Down
6 changes: 3 additions & 3 deletions grml-paste.1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ grml-paste(1)

Name
----
grml-paste - command line interface for paste.grml.org
grml-paste - command line interface for xmlrpc pastebins

Synopsis
--------
Expand All @@ -12,7 +12,7 @@ grml-paste [options] ACTION <args>
Description
-----------

grml-paste is a command line interface for uploading plain text to https://paste.grml.org/
grml-paste is a command line interface for uploading plain text to https://paste.debian.net/

Options
-------
Expand All @@ -35,7 +35,7 @@ Set your nickname (defaults to login username).

**-s 'server', --server='SERVER'**::

Set URL of paste server (defaults to paste.grml.org).
Set URL of paste server (defaults to paste.debian.net).

**-p, --private**::

Expand Down