mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 04:51:31 +08:00 
			
		
		
		
	ci: Set up a test release process
This commit is contained in:
		
							parent
							
								
									2b01392b41
								
							
						
					
					
						commit
						42c714891a
					
				
							
								
								
									
										1
									
								
								.github/workflows/main.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.github/workflows/main.yml
									
									
									
									
										vendored
									
									
								
							| @ -2,7 +2,6 @@ name: Main | |||||||
| on: | on: | ||||||
|   push: |   push: | ||||||
|     branches: |     branches: | ||||||
|       - "develop" |  | ||||||
|       - "feature/update**" |       - "feature/update**" | ||||||
|       - "feature/server_esm**" |       - "feature/server_esm**" | ||||||
|     paths-ignore: |     paths-ignore: | ||||||
|  | |||||||
							
								
								
									
										102
									
								
								.github/workflows/release.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										102
									
								
								.github/workflows/release.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,102 @@ | |||||||
|  | name: Main | ||||||
|  | on: | ||||||
|  |   push: | ||||||
|  |     branches: | ||||||
|  |       - develop | ||||||
|  |   workflow_dispatch:     | ||||||
|  | permissions: | ||||||
|  |   contents: write | ||||||
|  | concurrency: | ||||||
|  |   group: ${{ github.workflow }}-${{ github.ref }} | ||||||
|  |   cancel-in-progress: true | ||||||
|  | 
 | ||||||
|  | jobs: | ||||||
|  |   make-electron: | ||||||
|  |     name: Make Electron | ||||||
|  |     strategy: | ||||||
|  |       fail-fast: false | ||||||
|  |       matrix: | ||||||
|  |         arch: [x64, arm64] | ||||||
|  |         os: | ||||||
|  |           - name: macos | ||||||
|  |             image: macos-latest | ||||||
|  |             extension: dmg | ||||||
|  |           - name: linux | ||||||
|  |             image: ubuntu-latest | ||||||
|  |             extension: deb | ||||||
|  |           - name: windows | ||||||
|  |             image: windows-latest | ||||||
|  |             extension: exe | ||||||
|  |     runs-on: ${{ matrix.os.image }} | ||||||
|  |     steps: | ||||||
|  |       - uses: actions/checkout@v4 | ||||||
|  |       - name: Set up node & dependencies | ||||||
|  |         uses: actions/setup-node@v4 | ||||||
|  |         with: | ||||||
|  |           node-version: 20 | ||||||
|  |       - name: Set up Python for appdmg to be installed | ||||||
|  |         if: ${{ matrix.os.name == 'macos' }} | ||||||
|  |         run: brew install python-setuptools | ||||||
|  |       - name: Install dependencies | ||||||
|  |         run: npm ci | ||||||
|  |       - name: Update build info | ||||||
|  |         run: npm run update-build-info | ||||||
|  |       - name: Run electron-forge | ||||||
|  |         run: npm run make-electron -- --arch=${{ matrix.arch }} | ||||||
|  |       - name: Prepare artifacts (Unix) | ||||||
|  |         if: runner.os != 'windows' | ||||||
|  |         run: | | ||||||
|  |           mkdir -p upload | ||||||
|  |           file=$(find out/make -name '*.zip' -print -quit) | ||||||
|  |           cp "$file" "upload/TriliumNextNotes-${{ matrix.os.name }}-${{ matrix.arch }}-${{ github.ref_name }}.zip" | ||||||
|  |           file=$(find out/make -name '*.${{ matrix.os.extension }}' -print -quit) | ||||||
|  |           cp "$file" "upload/TriliumNextNotes-${{ matrix.os.name }}-${{ matrix.arch }}-${{ github.ref_name }}.${{ matrix.os.extension }}" | ||||||
|  |       - name: Prepare artifacts (Windows) | ||||||
|  |         if: runner.os == 'windows' | ||||||
|  |         run: | | ||||||
|  |           mkdir upload | ||||||
|  |           $file = Get-ChildItem -Path out/make -Filter '*.zip' -Recurse | Select-Object -First 1 | ||||||
|  |           Copy-Item -Path $file.FullName -Destination "upload/TriliumNextNotes-${{ matrix.os.name }}-${{ matrix.arch }}-${{ github.ref_name }}.zip" | ||||||
|  |           $file = Get-ChildItem -Path out/make -Filter '*.${{ matrix.os.extension }}' -Recurse | Select-Object -First 1 | ||||||
|  |           Copy-Item -Path $file.FullName -Destination "upload/TriliumNextNotes-${{ matrix.os.name }}-${{ matrix.arch }}-${{ github.ref_name }}.${{ matrix.os.extension }}" | ||||||
|  |       - name: Publish artifacts | ||||||
|  |         uses: actions/upload-artifact@v4 | ||||||
|  |         with: | ||||||
|  |           name: TriliumNextNotes ${{ matrix.os.name }} ${{ matrix.arch }}.zip | ||||||
|  |           path: upload/*.zip | ||||||
|  |       - name: Rename the output artifact | ||||||
|  |         run: | | ||||||
|  |           mv upload/*.${{ matrix.os.extension }} "upload/TriliumNextNotes ${{ matrix.os.name }} ${{ matrix.arch }}.${{matrix.os.extension}}" | ||||||
|  |       - name: Publish test | ||||||
|  |         uses: softprops/action-gh-release@v2 | ||||||
|  |         with: | ||||||
|  |           draft: true | ||||||
|  |           tag_name: test_release | ||||||
|  |           fail_on_unmatched_files: true | ||||||
|  |           files: upload/*.${{matrix.os.extension}} | ||||||
|  |   build_linux_server-x64: | ||||||
|  |     name: Build Linux Server x86_64 | ||||||
|  |     runs-on: ubuntu-latest | ||||||
|  |     steps: | ||||||
|  |       - uses: actions/checkout@v4 | ||||||
|  |       - name: Set up node & dependencies | ||||||
|  |         uses: actions/setup-node@v4 | ||||||
|  |         with: | ||||||
|  |           node-version: 20 | ||||||
|  |           cache: "npm" | ||||||
|  |       - name: Install dependencies | ||||||
|  |         run: npm ci | ||||||
|  |       - name: Run Linux server build (x86_64) | ||||||
|  |         run: | | ||||||
|  |           npm run update-build-info | ||||||
|  |           ./bin/build-server.sh | ||||||
|  |       - name: Prepare artifacts | ||||||
|  |         if: runner.os != 'windows' | ||||||
|  |         run: | | ||||||
|  |           mkdir -p upload | ||||||
|  |           file=$(find dist -name '*.tar.xz' -print -quit) | ||||||
|  |           cp "$file" "upload/TriliumNextNotes-linux-x64-${{ github.ref_name }}.tar.xz"           | ||||||
|  |       - uses: actions/upload-artifact@v4 | ||||||
|  |         with: | ||||||
|  |           name: TriliumNextNotes linux server x64 | ||||||
|  |           path: upload/TriliumNextNotes-linux-x64-${{ github.ref_name }}.tar.xz | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Elian Doran
						Elian Doran