Skip to content

Commit

Permalink
Release version 4.x (#390)
Browse files Browse the repository at this point in the history
    Remove parallelism when uploading files
    [CI] Move docs from gh-pages branch
    Upgrade gphotos to v3
    filetracker folder moved
    Implement list albums and list media-items
    [CI] Refactor cobra commands to be more testable
    [CI] Add test for CLI flags --silent and --debug
    Add support to go 1.21, remove go 1.19
  • Loading branch information
pacoorozco authored Oct 21, 2023
1 parent f472046 commit fc634f1
Show file tree
Hide file tree
Showing 80 changed files with 2,038 additions and 1,275 deletions.
21 changes: 21 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: 2
updates:
- package-ecosystem: 'gomod'
directory: '/'
schedule:
interval: 'weekly'
labels:
- 'dependencies'
commit-message:
prefix: 'Bump'
include: 'scope'

- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'weekly'
labels:
- 'dependencies'
commit-message:
prefix: '[CI]'
include: 'scope'
8 changes: 4 additions & 4 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v4
with:
go-version: '1.21'
go-version: 'stable'
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
uses: goreleaser/goreleaser-action@v5
with:
version: latest
args: release --rm-dist
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
name: Linter code
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: '1.21'
go-version: 'stable'
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ on:
branches:
- 'main'
- '*.x'
paths-ignore:
- 'docs/**'
- '*.md'
pull_request:
paths-ignore:
- 'docs/**'
- '*.md'
jobs:
test-matrix:
strategy:
Expand All @@ -13,7 +19,7 @@ jobs:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
Expand Down
70 changes: 49 additions & 21 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,34 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/) and this project adheres to [Semantic Versioning](https://semver.org/).

## 4.0.0
### Added
- Support for the latest published Go version (1.21). This project will maintain compatibility with the latest **two major versions** published.

### Changed
- Bump `github.com/sirupsen/logrus` from 1.9.0 to 1.9.3 ([#378][i378])
- Bump `github.com/spf13/afero` from 1.9.5 to 1.10.0 ([#379][i379])
- Bump `github.com/gphotosuploader/google-photos-api-client-go/v3` from 3.0.1 to 3.0.2
- Bump `golang.org/x/oauth2` from 0.12.0 to 0.13.0
- Bump `golang.org/x/sync` from 0.3.0 to 0.4.0 ([#377][i377])
- Bump `golang.org/x/term` from 0.10.0 to 0.13.0 ([#376][i376])
- [CI] Bump `github.com/stretchr/testify` from 1.7.0 to 1.8.4 ([#380][i380])
- [CI] Bump `actions/checkout` from 3 to 4 ([#375][i375])
- [CI] Bump `goreleaser/goreleaser-action` from 4 to 5 ([#374][i374])
- [CI] Bump `golangci` from 1.52.1 to 1.54.2

### Removed
- Support for multiple concurrent workers. The bandwidth to upload items is shared, so we are not expecting any performance problem.
- Removed DEPRECATED configuration parameters from previous versions.

[i374]: https://github.com/gphotosuploader/gphotos-uploader-cli/pulls/374
[i375]: https://github.com/gphotosuploader/gphotos-uploader-cli/pulls/375
[i376]: https://github.com/gphotosuploader/gphotos-uploader-cli/pulls/376
[i377]: https://github.com/gphotosuploader/gphotos-uploader-cli/pulls/377
[i378]: https://github.com/gphotosuploader/gphotos-uploader-cli/pulls/378
[i379]: https://github.com/gphotosuploader/gphotos-uploader-cli/pulls/379
[i380]: https://github.com/gphotosuploader/gphotos-uploader-cli/pulls/380

## 3.5.2
### Added
- Support for the latest published Go version (1.21). This project will maintain compatibility with the latest two major versions published.
Expand Down Expand Up @@ -50,15 +78,15 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this
### Changed
- The command `auth` initiates the [Google authentication to get an OAuth 2.0 token](https://gphotosuploader.github.io/gphotos-uploader-cli/#/getting-started?id=authentication). **It should be used the first time that the CLI is configured**. See [documentation](https://gphotosuploader.github.io/gphotos-uploader-cli/#/getting-started?id=authentication).
### Deprecated
- The OAuth 2.0 authentication based in out-of-band tokens is deprecated by Google. ([#326][i326])
- Google deprecates the OAuth 2.0 authentication based on out-of-band tokens. ([#326][i326])

[i326]: https://github.com/gphotosuploader/gphotos-uploader-cli/issues/326

## 3.3.1
### Added
- Support for the latest published Go version (1.18). This project will maintain compatibility with the latest two major versions published.
### Changed
- Dependency has been updated, so potential bugs has been fixed.
- Dependency has been updated, so potential bugs have been fixed.
### Deprecated
- Once Go 1.18 has been published, previous Go 1.16 support is deprecated.
### Removed
Expand Down Expand Up @@ -119,10 +147,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this
- Configuration validation. The cli validates the configuration data at starting time.
- Information messages to bring more context at runtime. ([#260][i260])
### Changed
- `Jobs.MakeAlbums` configuration setting has changed to `Jobs.CreateAlbums`. Valid values are "Off", "folderName" and "folderPath".
- **Reduced the number of calls to the API when uploading files**. It's using less than 50% of calls than before.
- `Jobs.MakeAlbums` configuration setting has changed to `Jobs.CreateAlbums`. Valid values are `Off`,`folderName` and `folderPath`.
- **Reduce the number of calls to the API when uploading files**. It's using less than 50% of calls than before.
- Move to `golang.org/x/term` from `golang.org/x/crypto/ssh/terminal`, due to deprecation.
- Some parts of the code has been refactored to make cleaner code and increase testability.
- Some parts of the code have been refactored to make cleaner code and increase testability.
- `Jobs.Account` configuration setting has been changed to `Account`. Multiple Google Photos accounts are not supported. ([#231][i231])
- Bump `google-photos-api-client-go` from `v2.0.0` to `v2.1.3`. It improves performance. ([#259][i259])
- Bump `golangci-lint` from `1.30.0` to `1.34.1`.
Expand Down Expand Up @@ -150,14 +178,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this

## 2.0.0
> This is a **major upgrade**, and it has some **non-backwards compatible changes**:
> - `includePatterns` & `excludePatterns` configuration options has changed.
> - `includePatterns` & `excludePatterns` configuration options have changed.
> - `includePatterns` has a new default (`_IMAGE_EXTENSIONS_`).
> - `uploadVideos` configuration option has been removed.
### Added
- Two new tagged patterns has been added: `_IMAGE_EXTENSIONS_`, matching [supported image file types](https://support.google.com/googleone/answer/6193313), and `_RAW_EXTENSIONS_`, matching [supported RAW file types](https://support.google.com/googleone/answer/6193313). ([#249][i249])
- Retries management. It's implementing exponential back-off with a maximum of 4 retries by default. ([#253][i253])
- Two new tagged patterns have been added: `_IMAGE_EXTENSIONS_`, matching [supported image file types](https://support.google.com/googleone/answer/6193313), and `_RAW_EXTENSIONS_`, matching [supported RAW file types](https://support.google.com/googleone/answer/6193313). ([#249][i249])
- Retry management. It's implementing exponential back-off with a maximum of 4 retries by default. ([#253][i253])
### Changed
- `includePatterns` & `excludePatterns` configuration options has changed. It's using a new format, please review de [configuration documentation][idocumentation].
- `includePatterns` & `excludePatterns` configuration options have changed. It's using a new format, please review de [configuration documentation][idocumentation].
- By default, if `includePatterns` is empty, `_IMAGE_EXTENSIONS_` will be used. ([#249][i249])
- Bump `google-photos-api-client-go` from `v2.0.0-beta-1` to `v2.0.0`.
### Fixed
Expand Down Expand Up @@ -292,7 +320,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this

## 0.8.6
### Changed
- Remove `build` from version. Now `version` has all the tag+build information.
- Remove `build` from a version. Now `version` has all the tag+build information.
### Fixed
- Fix duplicated album creation. ([#135][i135])

Expand All @@ -304,7 +332,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this

## 0.8.4
### Fixed
- Fix panic when a unexpected error on media item creation was raised. (#110)
- Fix panic when an unexpected error on media item creation was raised. (#110)
### Changed
- Update `gphotosuploader/google-photos-api-client-go` to v1.0.7.

Expand All @@ -328,11 +356,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this
- Updated `google-photos-api-client` to version v1.0.4 to help with broken album creation. (#19)

### Fixed
- Fix duplicated album creation due to concurrency problem. (#19)
- Fix duplicated album creation due to a concurrency problem. (#19)

## 0.8.0
### Added
- Uploads can be resumed. This will help uploading large files or when connection has fails. Thanks to @pdecat.
- Uploads can be resumed. This will help upload large files or when connection has fails. Thanks to @pdecat.

## 0.7.2
### Fixed
Expand All @@ -344,30 +372,30 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this
- Google Auth expired token refresh. Once token is expired, `gphotos-uploader-cli` will try to refresh the token without user intervention. **NOTE**: First time you use this version, you should re-authenticate in order to get the token that allows token refresh. (#103)
- Add `--config` flag to specify the folder where configuration is kept. (#104)
### Changed
- Moved CI/CD platform from Travis to [Drone.io](https://cloud.drone.io/gphotosuploader/gphotos-uploader-cli). It has reduce the time to CI by a half.
- Moved CI/CD platform from Travis to [Drone.io](https://cloud.drone.io/gphotosuploader/gphotos-uploader-cli). It has reduced the time to CI by a half.

## 0.6.0
### Added
- `deleteAfterUpload` option has been reactivated, it was removed on v0.4.0. If you use this option in [config file][idocumentation] files will be deleted from local repository after being uploaded to Google Photos. (#25)
### Changed
- This repository has transferred to [GPhotos Uploaders organization](https://github.com/gphotosuploader), so all imports has been updated to the new organization's URL.
- This repository has transferred to [GPhotos Uploaders organization](https://github.com/gphotosuploader), so all imports have been updated to the new organization's URL.
### Removed
- Removed some useless log lines. There are still too much.
- Removed some useless log lines. There is still too much.

## 0.5.0
### Changed
- Fix issue #97 "New gnome keyring store created on each launch". To solve this issue a new `serviceName` has been changed. **NOTE**: Once you use this version, a new Gnome keyring will be created, so credentials should be supplied again. (#97)

## 0.4.2
### Fixed
- Fix CI release pipeline to fix application version (#94). Last version was still broken on CI.
- Fix CI release pipeline to fix an application version (#94). The Last version was still broken on CI.

## 0.4.1
### Added
- Add Homebrew tap to allow users to install `gphotos-uploader-cli` using Homebrew. See [install](README.md) section.

### Fixed
- Fix CI release pipeline to fix application version (#94)
- Fix CI release pipeline to fix an application version (#94)

## 0.4.0
### Added
Expand Down Expand Up @@ -398,7 +426,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this
## 0.3.1
### Changed
- Move some dependencies to the new [gphotosuploader](https://github.com/gphotosuploader) organization
- `make test` is not as verbose as before. To make easier to see if there is an error
- `make test` is not as verbose as before. To make it easier to see if there is an error
### Removed
- Removed some useless and local vendor files

Expand Down Expand Up @@ -433,14 +461,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/) and this

## 0.1.16 - 2019-06-16
### Fixed
- Fix goreleaser configuration (remove deprecated statement)
- Fix goreleaser configuration (remove a deprecated statement)
- Update [Getting started](README.md) documentation

### Removed
- Remove [snap](https://snapcraft.io/snaps) application publication (someone has stolen our app name)

## 0.1.11 - 2018-09-20
### Added
- [goreleaser](https://goreleaser.com/) will be on charge of publishing [binaries](https://github.com/gphotosuploader/gphotos-uploader-cli/releases) after new release is done
- [goreleaser](https://goreleaser.com/) will be in charge of publishing [binaries](https://github.com/gphotosuploader/gphotos-uploader-cli/releases) after the new release is done

[idocumentation]: https://gphotosuploader.github.io/gphotos-uploader-cli/
31 changes: 14 additions & 17 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,19 @@ You are more than welcome to open issues in this project to [suggest new feature
## Contributing Code
This project is mainly written in Golang.

> This project will maintain compatibility with the last two Go major versions published. Currently Go 1.12 and Go 1.13.
> This project will maintain compatibility with the last two [golang major versions published](https://go.dev/doc/devel/release).
To contribute code:
1. Ensure you are running golang version 1.12 or greater
2. Set the following environment variables:
```
GO111MODULE=on
```
3. Fork the project
4. Clone the project: `git clone https://github.com/[YOUR_USERNAME]/gphotos-uploader-cli && cd gphotos-uploader-cli`
5. Run `go mod download` to install the dependencies
6. Make changes to the code
7. Run `make build` to build the project
8. Make changes
9. Run tests: `make test`
10. Format your code: `go fmt ./...`
11. Commit changes
12. Push commits
13. Open pull request
1. Ensure you are running a supported golang version
1. Fork the project
1. Clone the project: `git clone https://github.com/[YOUR_USERNAME]/gphotos-uploader-cli && cd gphotos-uploader-cli`
1. Run `go mod download` to install the dependencies
1. Make changes to the code
1. Run `make build` to build the project
1. Make changes
1. Run tests: `make test`
1. Run linter: `make lint`
1. Format your code: `go fmt ./...`
1. Commit changes
1. Push commits
1. Open pull request
14 changes: 8 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Use linker flags to provide version/build settings to the target
CONFIGURATION_PACKAGE := github.com/gphotosuploader/gphotos-uploader-cli/version

# This VERSION could be set calling `make VERSION=0.2.0`
VERSION ?= $(shell git describe --tags --always --dirty)
LDFLAGS=-ldflags "-X ${CONFIGURATION_PACKAGE}.versionString=$(VERSION)"

# Use linker flags to provide version/build settings to the target
VERSION_IMPORT_PATH := github.com/gphotosuploader/gphotos-uploader-cli/internal/cmd
RELEASE_VERSION_FLAGS=-X=${VERSION_IMPORT_PATH}.version=$(VERSION)
LDFLAGS=-ldflags "$(RELEASE_VERSION_FLAGS)"
TEST_VERSION="0.0.0-test.preview"
TEST_LDFLAGS=-ldflags "-X ${CONFIGURATION_PACKAGE}.versionString=$(TEST_VERSION)"

# go source files, ignore vendor directory
PKGS = $(shell go list ./... | grep -v /vendor)
Expand All @@ -16,7 +18,7 @@ TMP_DIR ?= .tmp
COVERAGE_FILE := $(TMP_DIR)/coverage.txt
COVERAGE_HTML_FILE := $(TMP_DIR)/coverage.html
GOLANGCI := $(TMP_DIR)/golangci-lint
GOLANGCI_VERSION := 1.55.5
GOLANGCI_VERSION := 1.55.0

# set how to open files based on OS and ARCH.
UNAME_OS := $(shell uname -s)
Expand All @@ -35,7 +37,7 @@ endif
test: ## Run all the tests
@echo "--> Running tests..."
@mkdir -p $(dir $(COVERAGE_FILE))
@go test -covermode=atomic -coverprofile=$(COVERAGE_FILE) -race -failfast -timeout=30s $(PKGS)
@go test -covermode=atomic -coverprofile=$(COVERAGE_FILE) -race -failfast -timeout=30s ${TEST_LDFLAGS} $(PKGS)

.PHONY: cover
cover: test ## Run all the tests and opens the coverage report
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
![logo](.docs/_media/gphotos-uploader-cli-logo.png)
![logo](docs/images/gphotos-uploader-cli-logo.png)

Command line tool to mass upload media folders to your Google Photos account.
Tool to mass upload media folders to your Google Photos account and manage it using a CLI.

[![Go Report Card](https://goreportcard.com/badge/github.com/gphotosuploader/gphotos-uploader-cli)](https://goreportcard.com/report/github.com/gphotosuploader/gphotos-uploader-cli)
[![codebeat badge](https://codebeat.co/badges/9f3561ad-2838-456e-bc92-68988eeb376b)](https://codebeat.co/projects/github-com-gphotosuploader-gphotos-uploader-cli-main)
Expand All @@ -11,7 +11,7 @@ Command line tool to mass upload media folders to your Google Photos account.

# Google Photos uploader CLI

While the official tool only supports Mac OS and Windows, this brings an uploader to Linux too. Lets you upload photos from, in theory, any OS for which you can compile a Go program.
While the official tool only supports macOS and Windows, this brings an uploader to Linux too. Lets you upload photos from, in theory, any OS for which you can compile a Go program.

See the [documentation site](https://gphotosuploader.github.io/gphotos-uploader-cli) for more information about this CLI.

Expand Down
35 changes: 31 additions & 4 deletions UPGRADING.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,39 @@
# Upgrading notes

## Upgrading To 2.0.0 from 1.x.x
## Upgrading To 4.x from 3.x

### Data folders
There are some changes inside the [configuration folder](https://gphotosuploader.github.io/gphotos-uploader-cli/#/getting-started?id=configure) (usually `~/.gphotos-uploader-cli`):

- The folder `uploads.db` **MUST be renamed** to `uploaded_files`.
- The folder `resumable_uploads.db` **MUST be renamed** to `ongoing_uploads`.
- The token files, named as email address, **MUST be moved** under the `tokens` folder.

The content of the configuration folder (e.g `~/.gphotos-uploader-cli`) should be:

```
-rw------- config.hjson
drwx------ ongoing_uploads
drwx------ tokens
drwx------ uploaded_files
```

> **ATTENTION**: If you don't follow the process above, all the information regarding the previous version will not be kept.
## Upgrading To 3.x from 2.x

### Configuration settings
- `Jobs.Account` configuration setting has been changed to `Account`. See [configuration documentation](https://gphotosuploader.github.io/gphotos-uploader-cli/#/configuration).
- `Jobs.MakeAlbums` configuration setting has changed to `Jobs.CreateAlbums`. See [configuration documentation](https://gphotosuploader.github.io/gphotos-uploader-cli/#/configuration?id=createalbums).
- **Multiple Google Photos account support has been removed**. You can use multiple configuration files in the same application folder instead.

## Upgrading To 2.x from 1.x

### Patterns definition

The `includePatterns` and `excludePatterns` configuration options has changed, see [configuration documentation](.docs/configuration.md). You should modify your configuration to honor the **new format**.
The `includePatterns` and `excludePatterns` configuration options has changed, see [configuration documentation](https://gphotosuploader.github.io/gphotos-uploader-cli/#/configuration). You should modify your configuration to honor the **new format**.

If you were using the tagged patterns (*\_ALL_FILES_* and *\_ALL_VIDEO_FILES_*) you don't need to do anything.
If you were using the tagged patterns (`_ALL_FILES_` and `_ALL_VIDEO_FILES_`) you don't need to do anything.

```bash
sourceFolder
Expand All @@ -23,4 +50,4 @@ Description | Current format | Previous format
Include all files | `includePatterns: "**"}` | `includePatterns: {"*"}`
Include only PNG files | `includePatterns: "**/*.png"}` | `includePatterns: {"*.png"}`
Include PNG files in `foo` folder | `includePatterns: "foo/*.png"}` | `includePatterns: {"*.png"}` <br> `excludePatterns: {"bar"}`


Empty file added docs/.nojekyll
Empty file.
Loading

0 comments on commit fc634f1

Please sign in to comment.