Compare commits

...

4 Commits

Author SHA1 Message Date
advplyr a467637cb5 Version bump v2.0.5 2022-04-29 12:59:35 -05:00
advplyr 1a23001955 Update version check to use releases from gh api instead of tags, add 5 minute buffer between checking for new releases 2022-04-29 12:20:51 -05:00
advplyr 8942dca31d Update docker-build workflow 2022-04-29 09:48:00 -05:00
advplyr 2a919012b6 Version bump 2.0.4 2022-04-28 18:43:00 -05:00
5 changed files with 47 additions and 20 deletions
+18 -2
View File
@@ -11,6 +11,8 @@ on:
paths: paths:
- client/** - client/**
- server/** - server/**
- index.js
- package.json
release: release:
types: [published, edited] types: [published, edited]
# Allows you to run workflow manually from Actions tab # Allows you to run workflow manually from Actions tab
@@ -29,16 +31,23 @@ jobs:
id: meta id: meta
uses: docker/metadata-action@v3 uses: docker/metadata-action@v3
with: with:
images: advplyr/audiobookshelf,ghcr.io/${{ github.repository_owner }}/audiobookshelf images: advplyr/audiobookshelf-dev,ghcr.io/${{ github.repository_owner }}/audiobookshelf-dev
tags: | tags: |
type=edge,branch=master type=edge,branch=master
type=semver,pattern={{version}} type=semver,pattern={{version}}
- name: Setup QEMU - name: Setup QEMU
uses: docker/setup-qemu-action@v1 uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1 uses: docker/setup-buildx-action@v1
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to Dockerhub - name: Login to Dockerhub
uses: docker/login-action@v1 uses: docker/login-action@v1
@@ -60,3 +69,10 @@ jobs:
context: . context: .
platforms: linux/amd64,linux/arm64,linux/arm/v7 platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true push: true
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
+20 -11
View File
@@ -485,6 +485,25 @@ export default {
}, },
resize() { resize() {
this.$store.commit('globals/updateWindowSize', { width: window.innerWidth, height: window.innerHeight }) this.$store.commit('globals/updateWindowSize', { width: window.innerWidth, height: window.innerHeight })
},
checkVersionUpdate() {
// Version check is only run if time since last check was 5 minutes
const VERSION_CHECK_BUFF = 1000 * 60 * 5 // 5 minutes
var lastVerCheck = localStorage.getItem('lastVerCheck') || 0
if (Date.now() - Number(lastVerCheck) > VERSION_CHECK_BUFF) {
this.$store
.dispatch('checkForUpdate')
.then((res) => {
localStorage.setItem('lastVerCheck', Date.now())
if (res && res.hasUpdate) this.showUpdateToast(res)
})
.catch((err) => console.error(err))
if (this.$route.query.error) {
this.$toast.error(this.$route.query.error)
this.$router.replace(this.$route.path)
}
}
} }
}, },
beforeMount() { beforeMount() {
@@ -503,17 +522,7 @@ export default {
this.$store.commit('setExperimentalFeatures', true) this.$store.commit('setExperimentalFeatures', true)
} }
this.$store this.checkVersionUpdate()
.dispatch('checkForUpdate')
.then((res) => {
if (res && res.hasUpdate) this.showUpdateToast(res)
})
.catch((err) => console.error(err))
if (this.$route.query.error) {
this.$toast.error(this.$route.query.error)
this.$router.replace(this.$route.path)
}
}, },
beforeDestroy() { beforeDestroy() {
window.removeEventListener('resize', this.resize) window.removeEventListener('resize', this.resize)
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "audiobookshelf-client", "name": "audiobookshelf-client",
"version": "2.0.3", "version": "2.0.5",
"description": "Audiobook manager and player", "description": "Audiobook manager and player",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
+7 -5
View File
@@ -33,11 +33,12 @@ export async function checkForUpdate() {
return return
} }
var largestVer = null var largestVer = null
await axios.get(`https://api.github.com/repos/advplyr/audiobookshelf/tags`).then((res) => { await axios.get(`https://api.github.com/repos/advplyr/audiobookshelf/releases`).then((res) => {
var tags = res.data var releases = res.data
if (tags && tags.length) { if (releases && releases.length) {
tags.forEach((tag) => { releases.forEach((release) => {
var verObj = parseSemver(tag.name) var tagName = release.tag_name
var verObj = parseSemver(tagName)
if (verObj) { if (verObj) {
if (!largestVer || largestVer.total < verObj.total) { if (!largestVer || largestVer.total < verObj.total) {
largestVer = verObj largestVer = verObj
@@ -50,6 +51,7 @@ export async function checkForUpdate() {
console.error('No valid version tags to compare with') console.error('No valid version tags to compare with')
return return
} }
return { return {
hasUpdate: largestVer.total > currVerObj.total, hasUpdate: largestVer.total > currVerObj.total,
latestVersion: largestVer.version, latestVersion: largestVer.version,
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "audiobookshelf", "name": "audiobookshelf",
"version": "2.0.3", "version": "2.0.5",
"description": "Self-hosted audiobook server for managing and playing audiobooks", "description": "Self-hosted audiobook server for managing and playing audiobooks",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {