Skip to content

Commit d314c08

Browse files
wip(feat): test build ci
1 parent a857e0c commit d314c08

1 file changed

Lines changed: 3 additions & 129 deletions

File tree

.github/workflows/release.yml

Lines changed: 3 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -51,140 +51,14 @@ jobs:
5151
run: pnpm install
5252

5353
- uses: tauri-apps/tauri-action@v0
54+
continue-on-error: true
5455
env:
5556
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
58+
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
5659
with:
5760
tagName: v__VERSION__
5861
releaseName: Majdata Hub v__VERSION__
5962
releaseDraft: false
6063
prerelease: false
6164
args: ""
62-
63-
- name: Build application
64-
run: pnpm build
65-
66-
- name: Create and push tag
67-
id: create_tag
68-
continue-on-error: true
69-
env:
70-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71-
shell: pwsh
72-
run: |
73-
$version = "${{ steps.version.outputs.version }}"
74-
git config user.name "github-actions[bot]"
75-
git config user.email "github-actions[bot]@users.noreply.github.com"
76-
git tag -a "v$version" -m "Release v$version"
77-
git push origin "v$version"
78-
79-
- name: Create Release
80-
id: create_release
81-
if: steps.create_tag.outcome == 'success'
82-
uses: actions/create-release@v1
83-
env:
84-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
85-
with:
86-
tag_name: v${{ steps.version.outputs.version }}
87-
release_name: Majdata Hub v${{ steps.version.outputs.version }}
88-
draft: false
89-
prerelease: false
90-
91-
- name: Get MSI files
92-
id: msi_files
93-
if: steps.create_tag.outcome == 'success'
94-
shell: pwsh
95-
run: |
96-
$msiPath = "src-tauri/target/release/bundle/msi"
97-
if (Test-Path $msiPath) {
98-
$files = Get-ChildItem -Path $msiPath -File
99-
$fileList = $files | ForEach-Object { $_.FullName }
100-
echo "Files found: $($files.Name -join ', ')"
101-
echo "files=$($fileList -join ';')" >> $env:GITHUB_OUTPUT
102-
} else {
103-
echo "No MSI directory found"
104-
echo "files=" >> $env:GITHUB_OUTPUT
105-
}
106-
107-
- name: Get NSIS files
108-
id: nsis_files
109-
if: steps.create_tag.outcome == 'success'
110-
shell: pwsh
111-
run: |
112-
$nsisPath = "src-tauri/target/release/bundle/nsis"
113-
if (Test-Path $nsisPath) {
114-
$files = Get-ChildItem -Path $nsisPath -File
115-
$fileList = $files | ForEach-Object { $_.FullName }
116-
echo "Files found: $($files.Name -join ', ')"
117-
echo "files=$($fileList -join ';')" >> $env:GITHUB_OUTPUT
118-
} else {
119-
echo "No NSIS directory found"
120-
echo "files=" >> $env:GITHUB_OUTPUT
121-
}
122-
123-
- name: Upload MSI files to Release
124-
if: steps.create_tag.outcome == 'success' && steps.msi_files.outputs.files != ''
125-
shell: pwsh
126-
env:
127-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
128-
run: |
129-
$files = "${{ steps.msi_files.outputs.files }}" -split ';'
130-
foreach ($file in $files) {
131-
if ($file -and (Test-Path $file)) {
132-
$fileName = Split-Path $file -Leaf
133-
echo "Uploading $fileName..."
134-
gh release upload v${{ steps.version.outputs.version }} "$file" --clobber
135-
}
136-
}
137-
138-
- name: Upload NSIS files to Release
139-
if: steps.create_tag.outcome == 'success' && steps.nsis_files.outputs.files != ''
140-
shell: pwsh
141-
env:
142-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
143-
run: |
144-
$files = "${{ steps.nsis_files.outputs.files }}" -split ';'
145-
foreach ($file in $files) {
146-
if ($file -and (Test-Path $file)) {
147-
$fileName = Split-Path $file -Leaf
148-
echo "Uploading $fileName..."
149-
gh release upload v${{ steps.version.outputs.version }} "$file" --clobber
150-
}
151-
}
152-
153-
- name: Move uploaded files to temp folder
154-
if: steps.create_tag.outcome == 'success'
155-
shell: pwsh
156-
run: |
157-
New-Item -ItemType Directory -Force -Path "temp" | Out-Null
158-
$msiPath = "src-tauri/target/release/bundle/msi"
159-
$nsisPath = "src-tauri/target/release/bundle/nsis"
160-
if (Test-Path $msiPath) {
161-
Get-ChildItem -Path $msiPath -File | ForEach-Object {
162-
Move-Item -Path $_.FullName -Destination "temp/" -Force
163-
echo "Moved $($_.Name) to temp/"
164-
}
165-
}
166-
if (Test-Path $nsisPath) {
167-
Get-ChildItem -Path $nsisPath -File | ForEach-Object {
168-
Move-Item -Path $_.FullName -Destination "temp/" -Force
169-
echo "Moved $($_.Name) to temp/"
170-
}
171-
}
172-
173-
- name: Commit files in temp folder
174-
if: steps.create_tag.outcome == 'success'
175-
shell: bash
176-
env:
177-
MIRROR_URL: ${{ vars.CNB_URL }}
178-
MIRROR_TOKEN: ${{ vars.CNB_TOKEN }}
179-
run: |
180-
version="${{ steps.version.outputs.version }}"
181-
cd temp
182-
git init
183-
git config user.name "github-actions[bot]"
184-
git config user.email "github-actions[bot]@users.noreply.github.com"
185-
git add .
186-
git commit -m "$version"
187-
AUTH_URL=$(echo "$MIRROR_URL" | sed -E "s#^https://#https://x-access-token:${MIRROR_TOKEN}@#")
188-
git remote remove mirror 2>/dev/null || true
189-
git remote add mirror "$AUTH_URL"
190-
git push mirror --all --force

0 commit comments

Comments
 (0)