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
9 changes: 7 additions & 2 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,19 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '11'
java-version: '17'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Upload JAR as artifact
uses: actions/upload-artifact@v3
with:
name: TodoApp-jar
path: target/*.jar
- name: Cache
uses: actions/[email protected]
with:
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Create Release

on:
push:
tags:
- 'v*'

jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: maven

- name: Build with Maven
run: mvn -B package --file pom.xml

- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: target/*.jar
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Maven build artifacts
target/

# IDE files
.idea/
*.iml

# OS files
.DS_Store
Thumbs.db
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,29 @@
# TodoApp

## Description
A command-line todo app that just happened one afternoon. It seemed like a good idea at the time.
A command-line todo app that just happened one afternoon. It seemed like a good idea at the time.

## Download
You can download the latest release from the [Releases page](https://github.com/gxtm/FileHandler/releases).

## Running the Application
```bash
java -jar TodoApp-1.0-SNAPSHOT.jar
```

## Available Commands
- `add` - Add a new TODO item
- `list` - List all TODO items
- `delete` or `remove` - Delete a TODO item
- `help` - Show help information

## Building from Source
This project uses Maven. To build:
```bash
mvn clean package
```

The JAR file will be created in the `target/` directory.

## Release Process
See [RELEASE.md](RELEASE.md) for information about creating releases.
48 changes: 48 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Release Process

This project has two GitHub Actions workflows for building and releasing the TodoApp JAR file.

## CI Workflow (maven.yml)

Runs on every push to `main` branch and on pull requests:
- Builds the project with Maven
- Uploads the JAR file as a workflow artifact
- Artifacts are available for download from the Actions tab

## Release Workflow (release.yml)

Triggers when a version tag is pushed (tags starting with `v`, e.g., `v1.0.0`, `v2.1.3`):
- Builds the project with Maven
- Creates a GitHub Release
- Attaches the JAR file to the release
- Generates release notes automatically

### Creating a Release

To create a new release:

1. Tag your commit with a version number:
```bash
git tag v1.0.0
git push origin v1.0.0
```

2. The workflow will automatically:
- Build the JAR file
- Create a GitHub Release with the tag
- Upload the JAR to the release

3. The release will be visible at: `https://github.com/gxtm/FileHandler/releases`

### JAR File Details

- **Artifact Name**: `TodoApp-1.0-SNAPSHOT.jar`
- **Main Class**: `me.gixu.Main`
- **Java Version**: 17

### Running the JAR

After downloading the JAR from a release, run it with:
```bash
java -jar TodoApp-1.0-SNAPSHOT.jar
```