name: "publish" on: push: tags: - 'v*' # 推送事件匹配 v*, 例如 v1.0,v20.15.10 等来触发工作流 jobs: # 任务:创建 release 版本 create-release: runs-on: ubuntu-latest outputs: RELEASE_UPLOAD_ID: ${{ steps.create_release.outputs.id }} steps: - uses: actions/checkout@v2 # 查询版本号(tag) - name: Query version number id: get_version shell: bash run: | echo "using version tag ${GITHUB_REF:10}" echo ::set-output name=version::"${GITHUB_REF:10}" # 根据查询到的版本号创建 release - name: Create Release id: create_release uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: tag_name: '${{ steps.get_version.outputs.VERSION }}' release_name: '唐僧叨叨 ${{ steps.get_version.outputs.VERSION }}' body: 'See the assets to download this version and install.' publish-tauri: needs: create-release strategy: fail-fast: false matrix: platform: [macos-latest, ubuntu-latest, windows-latest] runs-on: ${{ matrix.platform }} steps: - uses: actions/checkout@v2 - name: setup node uses: actions/setup-node@v1 with: node-version: 16 - name: install Rust stable uses: actions-rs/toolchain@v1 with: toolchain: stable - name: install dependencies (ubuntu only) if: matrix.platform == 'ubuntu-latest' run: | sudo apt-get update sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf - name: install app dependencies and build it run: yarn && yarn build - uses: tauri-apps/tauri-action@v0.4 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} # 密钥,需要提前配置在 Github Secrets中 TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} # 密钥的加密文本,与ssh-keygen时输入的密码一致即可。 需要提前配置在 Github Secrets中 with: releaseId: ${{ needs.create-release.outputs.RELEASE_UPLOAD_ID }} # tagName: v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version # releaseName: "v__VERSION__" # releaseBody: "See the assets to download this version and install." # releaseDraft: true # 不需要 draft 的可以改成 false # prerelease: false