Skip to content

Commit

Permalink
Added README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
slashtechno committed Oct 1, 2022
1 parent 9b3c594 commit e1591fa
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 14 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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/[email protected]
# 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/<owner>/<repo>/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/<owner>/<repo>/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

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/go-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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__*'
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/slashtechno/oauth-blogger
module github.com/slashtechno/api-blogger

go 1.19

Expand Down

0 comments on commit e1591fa

Please sign in to comment.