From e1591fa5770a4719cd862433bb28093bd8f79bd2 Mon Sep 17 00:00:00 2001 From: slashtechno <77907286+slashtechno@users.noreply.github.com> Date: Sat, 1 Oct 2022 01:03:47 -0500 Subject: [PATCH] Added README.md --- .github/workflows/ci.yml | 18 +++++++++--------- .github/workflows/go-build.yml | 8 ++++---- README.md | 18 ++++++++++++++++++ go.mod | 2 +- 4 files changed, 32 insertions(+), 14 deletions(-) create mode 100644 README.md diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fcc0c5f..9a7c52c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,11 +24,11 @@ jobs: with: xgo_version: latest go_version: 1.19 - dest: /home/runner/work/oauth-blogger/builds - prefix: oauth-blogger + dest: /home/runner/work/api-blogger/builds + prefix: api-blogger # targets: windows/amd64,linux/amd64,linux/arm64,darwin/arm64,windows/arm,windows/arm64,linux/arm,darwin/amd64 - name: Compress releases - run: zip -r /home/runner/work/oauth-blogger/binaries.zip /home/runner/work/oauth-blogger/builds/* + run: zip -r /home/runner/work/api-blogger/binaries.zip /home/runner/work/api-blogger/builds/* - name: Delete old release uses: Archaholic/action-delete-release@v1 env: @@ -49,23 +49,23 @@ jobs: # generate_release_notes: true body: "Latest commit: ${{ github.event.head_commit.message }}" files: | - /home/runner/work/oauth-blogger/binaries.zip - /home/runner/work/oauth-blogger/builds/* + /home/runner/work/api-blogger/binaries.zip + /home/runner/work/api-blogger/builds/* - name: uses: actions/upload-artifact@v3 with: name: binaries - path: /home/runner/work/oauth-blogger/builds/* + path: /home/runner/work/api-blogger/builds/* # - name: Rolling Publish # uses: WebFreak001/deploy-nightly@v1.2.0 # env: # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # automatically provided by github actions # with: - # upload_url: https://uploads.github.com/repos/slashtechno/oauth-blogger/releases/74787789/assets{?name,label} # find out this value by opening https://api.github.com/repos///releases in your browser and copy the full "upload_url" value including the {?name,label} part + # upload_url: https://uploads.github.com/repos/slashtechno/api-blogger/releases/74787789/assets{?name,label} # find out this value by opening https://api.github.com/repos///releases in your browser and copy the full "upload_url" value including the {?name,label} part # release_id: 74787789 # same as above (id can just be taken out the upload_url, it's used to find old releases) - # asset_path: /home/runner/work/oauth-blogger/binaries.zip # path to archive to upload - # asset_name: oauth-blogger-binaries-rolling-$$.zip # name to upload the release as, use $$ to insert date (YYYYMMDD) and 6 letter commit hash + # asset_path: /home/runner/work/api-blogger/binaries.zip # path to archive to upload + # asset_name: api-blogger-binaries-rolling-$$.zip # name to upload the release as, use $$ to insert date (YYYYMMDD) and 6 letter commit hash # asset_content_type: application/zip # required by GitHub API # max_releases: 2 # optional, if there are more releases than this matching the asset_name, the oldest ones are going to be deleted diff --git a/.github/workflows/go-build.yml b/.github/workflows/go-build.yml index a236a27..8e6e2ca 100644 --- a/.github/workflows/go-build.yml +++ b/.github/workflows/go-build.yml @@ -21,12 +21,12 @@ jobs: check-latest: true - name: Build (Not Windows) if: matrix.os != 'windows-latest' - run: 'go build -v -o oauth-blogger__${{ matrix.os }}' + run: 'go build -v -o api-blogger__${{ matrix.os }}' - name: Build (Windows) if: matrix.os == 'windows-latest' - run: 'go build -v -o oauth-blogger__${{ matrix.os }}.exe' + run: 'go build -v -o api-blogger__${{ matrix.os }}.exe' - uses: actions/upload-artifact@v3 with: name: binaries - # path: 'oauth-blogger__${{ matrix.os }}' - path: 'oauth-blogger__*' + # path: 'api-blogger__${{ matrix.os }}' + path: 'api-blogger__*' diff --git a/README.md b/README.md new file mode 100644 index 0000000..7b916cd --- /dev/null +++ b/README.md @@ -0,0 +1,18 @@ +# API-blogger +Cross-service (and cross-platform) blog posting utility + +### Installation +#### Compiled Binaries +Compiled binaries can be downloaded from Github Releases. +#### Compile locally +To compile this program, run `go build` inside the project root after cloning the repository. +#### `go install` +Using `go install`, you can compile and add the program to the PATH. +Either run `go install github.com/slashtechno/api-blogger@latest`, follow the same process as compiling the program locally, but replace `go build` with `go install`. + +### Usage +In order to use this program, a configuration file must be supplied. Depending on your use case, the configuration varies. When running the program, it will create a basic `config.json` file which you can add the required information to. +#### CLI Flags +The default behaviour of the program is to bring up a simple interactive menu. However, command line flags can be used as well. The following are examples, for full usage, run `api-blogger --help` +* `api-blogger --source markdown --source-specifier file.md --title "Post from API-blogger" --post-to-devto --post-to-html output.html --skip-destination-prompt` - Post to an HTML file and [dev.to](https://dev.to/) with a markdown file as the source without using the interactive menu +* `api-blogger --source dev.to --source-specifier https://dev.to/example/example-post-0000 --title "Another post from API-blogger" --post-to-blogger` - Post to blogger from a dev.to article. This does not prevent the interactive menu from being outputted \ No newline at end of file diff --git a/go.mod b/go.mod index 8fd7689..6142fb8 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/slashtechno/oauth-blogger +module github.com/slashtechno/api-blogger go 1.19