diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 095c58e..66bfdd9 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -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/cache@v3.0.7 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..3ce8917 --- /dev/null +++ b/.github/workflows/release.yml @@ -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 }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9541da9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +# Maven build artifacts +target/ + +# IDE files +.idea/ +*.iml + +# OS files +.DS_Store +Thumbs.db diff --git a/README.md b/README.md index bd8ced1..cc310c3 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/RELEASE.md b/RELEASE.md new file mode 100644 index 0000000..c5705a9 --- /dev/null +++ b/RELEASE.md @@ -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 +```