name: Release on: workflow_dispatch: inputs: tag_name: description: 'Tag name for release' required: false default: nightly push: tags: ["v[0-9]+.[0-9]+.[0-9]+*"] env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} CARGO_TERM_COLOR: always jobs: windows: runs-on: windows-latest defaults: run: shell: bash steps: - uses: actions/checkout@v2 - name: Update rust run: rustup update - name: Build run: cargo build --profile release-lto - name: Install WiX run: nuget install WiX - name: Crate msi installer run: | ./WiX.*/tools/candle.exe -arch "x64" -ext WixUIExtension -ext WixUtilExtension \ -out "./lapce.wixobj" "extra/windows/wix/lapce.wxs" ./WiX.*/tools/light.exe -ext WixUIExtension -ext WixUtilExtension \ -out "./Lapce-windows.msi" -sice:ICE61 -sice:ICE91 \ "./lapce.wixobj" - name: Create portable shell: pwsh run: | Compress-Archive ./target/release-lto/lapce.exe ./Lapce-windows-portable.zip - uses: actions/upload-artifact@v3 with: name: lapce-windows path: | ./Lapce-windows-portable.zip ./Lapce-windows.msi retention-days: 1 linux: runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 - name: Install dependencies run: | sudo apt-get install cmake pkg-config libfontconfig-dev libgtk-3-dev - name: Update rust run: rustup update - name: Build run: cargo build --profile release-lto - name: Gzip run: | mkdir Lapce cp ./target/release-lto/lapce Lapce/ tar -zcvf ./Lapce-linux.tar.gz Lapce gzip -c "./target/release-lto/lapce-proxy" > ./lapce-proxy-linux.gz - uses: actions/upload-artifact@v3 with: name: lapce-linux path: | ./Lapce-linux.tar.gz ./lapce-proxy-linux.gz retention-days: 1 macos: runs-on: macos-11 env: NOTARIZE_USERNAME: ${{ secrets.NOTARIZE_USERNAME }} NOTARIZE_PASSWORD: ${{ secrets.NOTARIZE_PASSWORD }} steps: - uses: actions/checkout@v2 - name: Install ARM target run: rustup update && rustup target add aarch64-apple-darwin - name: Import Certificate uses: apple-actions/import-codesign-certs@v1 with: p12-file-base64: ${{ secrets.MACOS_CERTIFICATE }} p12-password: ${{ secrets.MACOS_CERTIFICATE_PWD }} - name: Make DMG run: make dmg-universal - name: Rename run: | cp ./target/release-lto/macos/Lapce.dmg ./target/release-lto/macos/Lapce-macos.dmg - name: "Notarize Release Build" run: | npx notarize-cli --file ./target/release-lto/macos/Lapce-macos.dmg --bundle-id io.lapce --asc-provider CYSGAZFR8D - name: "Staple Release Build" uses: devbotsxyz/xcode-staple@v1 with: product-path: "./target/release-lto/macos/Lapce-macos.dmg" - uses: actions/upload-artifact@v3 with: name: lapce-macos path: | ./target/release-lto/macos/Lapce-macos.dmg retention-days: 1 publish: needs: [linux, windows, macos] runs-on: ubuntu-20.04 env: GH_REPO: ${{ github.repository }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} permissions: contents: write steps: # Must perform checkout first, since it deletes the target directory # before running, and would therefore delete the downloaded artifacts - uses: actions/checkout@v3 - uses: actions/download-artifact@v3 - if: github.event_name == 'workflow_dispatch' run: echo "TAG_NAME=${{ github.event.inputs.tag_name }}" >> $GITHUB_ENV - if: github.event_name == 'schedule' run: echo 'TAG_NAME=nightly' >> $GITHUB_ENV - if: github.event_name == 'push' run: | TAG_NAME=${{ github.ref }} echo "TAG_NAME=${TAG_NAME#refs/tags/}" >> $GITHUB_ENV - if: env.TAG_NAME == 'nightly' run: | (echo 'SUBJECT=Lapce development build'; echo 'PRERELEASE=--prerelease') >> $GITHUB_ENV gh release delete nightly --yes || true git push origin :nightly || true - if: env.TAG_NAME != 'nightly' run: | (echo 'SUBJECT=Lapce release build'; echo 'PRERELEASE=') >> $GITHUB_ENV - name: Publish release env: DEBUG: api run: | gh release create $TAG_NAME $PRERELEASE --title "$TAG_NAME" --target $GITHUB_SHA lapce-macos/* lapce-linux/* lapce-windows/*