Merge pull request 'feat: configured semantic releases' (#307) from semantic-releases into staging
All checks were successful
Release to Staging / build_and_release (push) Successful in 2m4s

Reviewed-on: #307
This commit is contained in:
b 2025-01-29 13:49:15 +00:00
commit af036b1bb7
6 changed files with 8774 additions and 12 deletions

View File

@ -26,9 +26,27 @@ jobs:
- name: Create Build - name: Create Build
run: npm run build run: npm run build
- name: Release Build - name: Deploy Build
run: | run: |
npm -g install cloudron-surfer npm -g install cloudron-surfer
surfer config --token ${{ secrets.CLOUDRON_SURFER_TOKEN }} --server sigit.io surfer config --token ${{ secrets.CLOUDRON_SURFER_TOKEN }} --server sigit.io
surfer put dist/* / --all -d surfer put dist/* / --all -d
surfer put dist/.well-known / --all surfer put dist/.well-known / --all
- name: Create Empty Release (assets are posted later)
run: |
npm i
npm i -g semantic-release
# We do a semantic-release DRY RUN to make the job fail if there are no changes to release
GITEA_TOKEN=${{ secrets.RELEASE_TOKEN }} GITEA_URL=https://git.nostrdev.com/sigit/sigit.io semantic-release --dry-run | grep -q "There are no relevant changes, so no new version is released." && exit 1
GITEA_TOKEN=${{ secrets.RELEASE_TOKEN }} GITEA_URL=https://git.nostrdev.com/sigit/sigit.io semantic-release
- name: Upload assets to release
run: |
RELEASE_ID=`curl -k 'https://git.nostrdev.com/sigit/sigit.io/api/v1/repos/sigit/sigit.io/releases/latest?access_token=${{ secrets.RELEASE_TOKEN }}' | jq -r '.id'`
RELEASE_BODY=`curl -k 'https://git.nostrdev.com/sigit/sigit.io/api/v1/repos/sigit/sigit.io/releases/latest?access_token=${{ secrets.RELEASE_TOKEN }}' | jq -r '.body'`
# Update body
curl --data '{"draft": false,"body":"'"$RELEASE_BODY\n\nFor installation instructions, please visit https://docs.sigit.io/#/"'"}' -X PATCH --header 'Content-Type: application/json' -k https://git.nostrdev.com/sigit/sigit.io/api/v1/repos/sigit/sigit.io/releases/$RELEASE_ID?access_token=${{ secrets.RELEASE_TOKEN }}
# Upload assets
URL="https://git.nostrdev.com/sigit/sigit.io/api/v1/repos/sigit/sigit.io/releases/$RELEASE_ID/assets?access_token=${{ secrets.RELEASE_TOKEN }}"
curl -k $URL -F attachment=@dist.zip

2
.gitignore vendored
View File

@ -8,7 +8,7 @@ pnpm-debug.log*
lerna-debug.log* lerna-debug.log*
node_modules node_modules
dist dist-zip
dist-ssr dist-ssr
*.local *.local

31
.releaserc Normal file
View File

@ -0,0 +1,31 @@
{
"branches": [
"main"
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/changelog",
"@semantic-release/npm",
[
"@semantic-release/git",
{
"assets": [
"CHANGELOG.md",
"package.json"
]
}
],
[
"@saithodev/semantic-release-gitea",
{
"giteaUrl": "https://git.nostrdev.com/sigit/sigit.io",
"assets": [
{
"path": "dist-zip/dist.zip"
}
]
}
]
]
}

8714
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -17,7 +17,8 @@
"preview": "vite preview", "preview": "vite preview",
"preinstall": "git config core.hooksPath .git-hooks", "preinstall": "git config core.hooksPath .git-hooks",
"license-checker": "node licenseChecker.cjs", "license-checker": "node licenseChecker.cjs",
"lint-staged": "lint-staged" "lint-staged": "lint-staged",
"release": "commit-and-tag-version"
}, },
"dependencies": { "dependencies": {
"@emotion/react": "11.11.4", "@emotion/react": "11.11.4",
@ -65,6 +66,12 @@
"use-immer": "^0.11.0" "use-immer": "^0.11.0"
}, },
"devDependencies": { "devDependencies": {
"@saithodev/semantic-release-gitea": "^2.1.0",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/commit-analyzer": "^10.0.1",
"@semantic-release/git": "^10.0.1",
"@semantic-release/npm": "11.0.0",
"@semantic-release/release-notes-generator": "^11.0.4",
"@types/crypto-js": "^4.2.2", "@types/crypto-js": "^4.2.2",
"@types/file-saver": "2.0.7", "@types/file-saver": "2.0.7",
"@types/lodash": "4.14.202", "@types/lodash": "4.14.202",
@ -75,6 +82,7 @@
"@typescript-eslint/eslint-plugin": "^7.0.2", "@typescript-eslint/eslint-plugin": "^7.0.2",
"@typescript-eslint/parser": "^7.0.2", "@typescript-eslint/parser": "^7.0.2",
"@vitejs/plugin-react": "^4.2.1", "@vitejs/plugin-react": "^4.2.1",
"commit-and-tag-version": "^11.2.2",
"eslint": "^8.56.0", "eslint": "^8.56.0",
"eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.5", "eslint-plugin-react-refresh": "^0.4.5",
@ -85,6 +93,7 @@
"typescript": "^5.2.2", "typescript": "^5.2.2",
"vite": "^5.1.4", "vite": "^5.1.4",
"vite-plugin-node-polyfills": "^0.22.0", "vite-plugin-node-polyfills": "^0.22.0",
"vite-plugin-zip-pack": "^1.2.4",
"vite-tsconfig-paths": "4.3.2" "vite-tsconfig-paths": "4.3.2"
}, },
"lint-staged": { "lint-staged": {

View File

@ -2,6 +2,7 @@ import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react' import react from '@vitejs/plugin-react'
import tsconfigPaths from 'vite-tsconfig-paths' import tsconfigPaths from 'vite-tsconfig-paths'
import { nodePolyfills } from 'vite-plugin-node-polyfills' import { nodePolyfills } from 'vite-plugin-node-polyfills'
import zipPack from 'vite-plugin-zip-pack'
export default defineConfig({ export default defineConfig({
plugins: [ plugins: [
@ -9,7 +10,8 @@ export default defineConfig({
tsconfigPaths(), tsconfigPaths(),
nodePolyfills({ nodePolyfills({
include: ['os'] include: ['os']
}) }),
zipPack()
], ],
build: { build: {
target: 'ES2022' target: 'ES2022'