Skip to content

Commit

Permalink
🐛 fix(app): fix release issues
Browse files Browse the repository at this point in the history
  • Loading branch information
angelespejo committed Jul 29, 2024
1 parent 7690abf commit cba79d4
Show file tree
Hide file tree
Showing 16 changed files with 126 additions and 48 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/release-apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,17 @@ jobs:
matrix:
settings:
- platform: 'macos-latest'
tauriScript: 'tauri build'
# args: '--target universal-apple-darwin'
# - platform: 'macos-latest'
# args: '--target x86_64-apple-darwin'
# - platform: 'macos-latest'
# args: '--target aarch64-apple-darwin'
# - platform: 'macos-latest'
- platform: 'ubuntu-22.04'
tauriScript: 'tauri build'
- platform: 'windows-latest'
tauriScript: false
timeout-minutes: 20
runs-on: ${{ matrix.settings.platform }}
env:
Expand All @@ -56,7 +59,7 @@ jobs:
if: matrix.settings.platform == 'macos-latest'
uses: dtolnay/rust-toolchain@stable
with:
target: 'aarch64-apple-darwin'
targets: 'aarch64-apple-darwin,x86_64-apple-darwin,universal-apple-darwin'

- name: 🦀 Rust setup
if: matrix.settings.platform != 'macos-latest'
Expand Down Expand Up @@ -136,7 +139,7 @@ jobs:
includeUpdaterJson: true
updaterJsonKeepUniversal: true # @see https://github.com/tauri-apps/tauri-action?tab=readme-ov-file#build-options
includeRelease: true
tauriScript: pnpm tauri
tauriScript: ${{ matrix.settings.tauriScript }}
# args: ${{ matrix.settings.args }}


Expand Down Expand Up @@ -193,7 +196,7 @@ jobs:
uses: docker/metadata-action@v3
with:
images: ${{ github.repository }}:${{ env.UPDATED_VERSION }},$${{ env.REPO_LATEST }}
description: ${{ steps.pkg.outputs.description }}
# description: ${{ steps.pkg.outputs.description }}
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_ACCESS_TOKEN }}
Expand Down
71 changes: 35 additions & 36 deletions .github/workflows/release-exts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
uses: ncipollo/release-action@v1
with:
tag: "${{ env.UPDATED_VERSION }}"
name: '${{ steps.pkg.outputs.name }} v${{ steps.updated.outputs.core_version }}'
name: '${{ steps.pkg.outputs.name }} v${{ steps.pkg.outputs.exts_version }}'
draft: false
prerelease: false
allowUpdates: true
Expand All @@ -90,53 +90,52 @@ jobs:
🧩 CHANGELOG: ${{ steps.pkg.outputs.repo }}/blob/main/packages/app/CHANGELOG.md
📜 LICENSE: ${{ steps.pkg.outputs.repo }}/blob/main/LICENSE
#########################################################################
# PUBLISH IN CHROME WEB STORE
#########################################################################

# - name: 🧩 Upload CHROME extension
# uses: Klemensas/chrome-extension-upload-action@v1.3
# with:
# refresh-token: '${{ secrets.CHOME_EXTENSION_REFRESH_TOKEN }}'
# client-id: '${{ secrets.CHOME_EXTENSION_CLIENT_ID }}'
# client-secret: '${{ secrets.CHOME_EXTENSION_CLIENT_SECRET }}'
# file-name: "packages/exts/exts/${{ steps.pkg.outputs.id }}-chrome.zip"
# app-id: '${{steps.pkg.outputs.chrome_storeId}}'
# publish: true


#########################################################################
# PUBLISH IN EDGE WEB STORE
#########################################################################

# - name: 🧩 Upload EDGE extension
# uses: inverse/edge-addon@v1.0.1
# with:
# product_id: ${{ secrets.EDGE_PRODUCT_ID }}
# client_id: ${{ secrets.EDGE_CLIENT_ID }}
# client_secret: ${{ secrets.EDGE_CLIENT_SECRET }}
# access_token_url: ${{ secrets.EDGE_ACCESS_TOKEN_URL }}
# zip: packages/exts/dist/exts/${{ steps.pkg.outputs.id }}-edge.zip"
# notes: New version upload # Could be derived from release notes


#########################################################################
# PUBLISH IN FIREFOX WEB STORE
#########################################################################

# @see https://github.com/marketplace/actions/publish-firefox-add-on
- name: 🧩🦊 Upload FIREFOX extension
uses: wdzeng/firefox-addon@v1
uses: trmcnvn/firefox-addon@v1
with:
# uuid is only necessary when updating an existing addon,
# omitting it will create a new addon
addon-guid: '${{ steps.pkg.outputs.firefox_storeId }}'
xpi-path: "packages/exts/dist/exts/${{ steps.pkg.outputs.id }}-firefox.zip"
uuid: '${{ steps.pkg.outputs.firefox_storeId }}'
xpi: "packages/exts/dist/exts/${{ steps.pkg.outputs.id }}-firefox.zip"
manifest: packages/exts/dist/firefox/manifest.json
# get keys in:
# https://addons.mozilla.org/en-US/developers/addon/api/key/
jwt-issuer: ${{ secrets.FIREFOX_JWT_ISSUER }}
jwt-secret: ${{ secrets.FIREFOX_JWT_SECRET }}
api-key: ${{ secrets.FIREFOX_API_KEY }}
api-secret: ${{ secrets.FIREFOX_API_SECRET }}
continue-on-error: true

#########################################################################
# PUBLISH IN CHROME WEB STORE
#########################################################################

- name: 🧩 Upload CHROME extension
uses: Klemensas/chrome-extension-upload-action@v1.3
with:
refresh-token: '${{ secrets.CHOME_EXTENSION_REFRESH_TOKEN }}'
client-id: '${{ secrets.CHOME_EXTENSION_CLIENT_ID }}'
client-secret: '${{ secrets.CHOME_EXTENSION_CLIENT_SECRET }}'
file-name: "packages/exts/exts/${{ steps.pkg.outputs.id }}-chrome.zip"
app-id: '${{steps.pkg.outputs.chrome_storeId}}'
continue-on-error: true

#########################################################################
# PUBLISH IN EDGE WEB STORE
#########################################################################

- name: 🧩 Upload EDGE extension
uses: inverse/edge-addon@v1.0.1
with:
product_id: ${{ steps.pkg.outputs.edge_storeId }}
client_id: ${{ secrets.EDGE_CLIENT_ID }}
client_secret: ${{ secrets.EDGE_CLIENT_SECRET }}
access_token_url: ${{ secrets.EDGE_ACCESS_TOKEN_URL }}
zip: packages/exts/dist/exts/${{ steps.pkg.outputs.id }}-edge.zip"
notes: New version upload # Could be derived from release notes
continue-on-error: true


Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"push-origin": "git add . && pnpm cm && git push -f origin $@",
"push-main": "pnpm push-origin main",
"push-dev": "pnpm push-origin dev",
"update-version": "changeset && changeset version",
"update-version": "changeset && changeset version && pnpm app update-version",
"release": "changeset publish",
"todo": "node --experimental-modules .dev/todo.mjs",
"readme": "node --experimental-modules .dev/readme.mjs"
Expand Down Expand Up @@ -108,7 +108,6 @@
"@sveltejs/adapter-auto": "3.2.2",
"@sveltejs/adapter-static": "3.0.2",
"@sveltejs/kit": "2.5.18",
"@sveltejs/package": "2.2.6",
"@sveltejs/vite-plugin-svelte": "3.1.1",
"@tsconfig/svelte": "5.0.4",
"@typescript-eslint/eslint-plugin": "6.21.0",
Expand Down
2 changes: 2 additions & 0 deletions packages/_core-react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# @s-8/core-react

## 0.2.3

## 0.2.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/_core-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@s-8/core-react",
"version": "0.2.2",
"version": "0.2.3",
"type": "module",
"publishConfig": {
"access": "public",
Expand Down
2 changes: 2 additions & 0 deletions packages/_core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# @s-8/core

## 0.2.3

## 0.2.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/_core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@s-8/core",
"description": "Super8 core functionality",
"version": "0.2.2",
"version": "0.2.3",
"type": "module",
"publishConfig": {
"access": "public",
Expand Down
52 changes: 52 additions & 0 deletions packages/app/.dev/update-cargo-version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@

/**
* Update-version.mjs.
*
* @description Update cargo version.
*/

import {
readFile, writeFile,
} from 'fs/promises'
import path from 'path'

const updateCargoVersion = async () => {

try {

// Leer package.json
const packageJsonPath = path.join( process.cwd(), 'package.json' )
const packageJson = JSON.parse( await readFile( packageJsonPath, 'utf-8' ) )
const newVersion = packageJson.version

// Leer Cargo.toml
const cargoTomlPath = path.join( process.cwd(), 'src-tauri', 'Cargo.toml' )
let cargoTomlContent = await readFile( cargoTomlPath, 'utf-8' )

// Buscar y reemplazar la línea con la versión
const versionRegex = /^version\s*=\s*"(.*)"/m
if ( versionRegex.test( cargoTomlContent ) ) {

cargoTomlContent = cargoTomlContent.replace( versionRegex, `version = "${newVersion}"` )

} else {

// Si no existe el campo, lo agregamos al final del archivo
cargoTomlContent += `\n[package]\nversion = "${newVersion}"\n`

}

// Escribir el archivo actualizado
await writeFile( cargoTomlPath, cargoTomlContent, 'utf-8' )

console.log( `Version updated to ${newVersion} in Cargo.toml` )

} catch ( error ) {

console.error( 'Error updating Cargo.toml version:', error )

}

}

updateCargoVersion()
6 changes: 6 additions & 0 deletions packages/app/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @s-8/app

## 0.2.3

### Patch Changes

- Fix release issues

## 0.2.2

### Patch Changes
Expand Down
3 changes: 2 additions & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@s-8/app",
"version": "0.2.2",
"version": "0.2.3",
"type": "module",
"private": true,
"scripts": {
Expand All @@ -10,6 +10,7 @@
"build:app": "tauri build",
"build:web": "vite build",
"dev:web": "vite",
"update-version": "node .dev/update-cargo-version.js",
"dev:android": "tauri android dev",
"dev:ios": "tauri ios dev",
"preview:web": "vite preview",
Expand Down
2 changes: 1 addition & 1 deletion packages/app/src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/app/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Some of this are used in build process of tauri
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
name = "super8"
version = "0.2.2"
version = "0.2.3"
description = "🎬🎨🧩 Add styles to web video like iFrames, YouTube & Vimeo videos, Netflix, Amazon etc"
authors = ["angelo <angelo@pigeonposse.com>"]
# license = "GPL-3.0"
Expand Down
3 changes: 2 additions & 1 deletion packages/app/src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,6 @@
}
}
},
"productName": "Super8"
"productName": "Super8",
"version": "../package.json"
}
2 changes: 2 additions & 0 deletions packages/exts/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# @s-8/exts

## 0.2.3

## 0.2.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/exts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@s-8/exts",
"description": "Super8 browser extensions",
"private": true,
"version": "0.2.2",
"version": "0.2.3",
"type": "module",
"license": "GPL-3.0",
"scripts": {
Expand Down
11 changes: 11 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit cba79d4

Please sign in to comment.