diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 140c623..8cbb7ca 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -13,27 +13,27 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v4 with: go-version: 1.15 - name: Test - run: go test -v ./... + run: go test -v ./downloader # There is only a test in this folder - name: Build if: success() run: | GOOS=windows go build -ldflags "-s -w" GOOS=darwin go build -o gitmoo-goog-osx -ldflags "-s -w" - go build -ldflags "-s -w" + go build -ldflags "-s -w" -o gitmoo-goog cd installer go build ./installer cd .. - zip gitmoo-goog.zip installer/*.deb gitmoo-goog-osx gitmoo-goog.exe + zip gitmoo-goog.zip installer/*.deb gitmoo-goog gitmoo-goog-osx gitmoo-goog.exe - name: Create Release id: create_release diff --git a/downloader/downloader_test.go b/downloader/downloader_test.go index 6e0b5e0..ed6627b 100644 --- a/downloader/downloader_test.go +++ b/downloader/downloader_test.go @@ -3,6 +3,7 @@ package downloader import ( "encoding/json" "io/ioutil" + "mime" "os" "path/filepath" "testing" @@ -124,7 +125,9 @@ func TestCreateFileName(t *testing.T) { item.MediaMetadata.CreationTime = "2019-10-13T17:33:43Z" have := downloader.createFileName(item, 0) - want := "13_34567890.jpe" + // Extensions can vary by system and will just defer to that for the correct extension + ext, _ := mime.ExtensionsByType(item.MimeType) + want := "13_34567890" + ext[0] if have != want { t.Errorf("downloader.createFileName() = %v; want %v", have, want)