Giter Club home page Giter Club logo

Comments (1)

aharshbe avatar aharshbe commented on June 6, 2024

Updated release.yml:

name: Leo Release
on:
  push:
    tags:
      - 'v*.*.*'

env:
  RUST_BACKTRACE: 1

jobs:
  ubuntu:
    name: Ubuntu
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v1

      - name: Install Rust
        uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          override: true
          components: rustfmt

      - name: Build Leo
        run: |
          cargo build --package leo-lang --release --features noconfig && strip target/release/leo
        env:
          CARGO_NET_GIT_FETCH_WITH_CLI: true

      - id: get_version
        uses: battila7/get-version-action@v2

      - name: Zip
        run: |
          mkdir tempdir
          mv target/release/leo tempdir
          cd tempdir
          zip -r leo-${{ steps.get_version.outputs.version }}-x86_64-unknown-linux-gnu.zip leo
          cd ..
          mv tempdir/leo-${{ steps.get_version.outputs.version }}-x86_64-unknown-linux-gnu.zip .

      - name: Release
        uses: softprops/action-gh-release@v1
        if: startsWith(github.ref, 'refs/tags/')
        with:
          files: |
            leo-${{ steps.get_version.outputs.version }}-x86_64-unknown-linux-gnu.zip
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

  linux-musl:
    name: Linux musl
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      - name: Install Rust
        uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          override: true
          components: rustfmt
          target: x86_64-unknown-linux-musl
          default: stable-x86_64-unknown-linux-musl

      - name: Build
        run: |
          docker pull clux/muslrust:stable
          docker run -v cargo-cache:/root/.cargo/registry -v $PWD:/volume --rm -t clux/muslrust:stable cargo build --target x86_64-unknown-linux-musl --package leo-lang --release --features noconfig && ldd target/x86_64-unknown-linux-musl/release/leo
      - id: get_version
        uses: battila7/get-version-action@v2

      - name: Zip
        run: |
          mkdir tempdir
          cp target/x86_64-unknown-linux-musl/release/leo tempdir
          strip tempdir/leo
          cd tempdir
          zip -r leo-${{ steps.get_version.outputs.version }}-x86_64-unknown-linux-musl.zip leo
          cd ..
          mv tempdir/leo-${{ steps.get_version.outputs.version }}-x86_64-unknown-linux-musl.zip .

      - name: Release
        uses: softprops/action-gh-release@v1
        if: startsWith(github.ref, 'refs/tags/')
        with:
          files: |
            leo-${{ steps.get_version.outputs.version }}-x86_64-unknown-linux-musl.zip
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

  macos:
    name: macOS
    runs-on: macos-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v1

      - name: Install Rust
        uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          override: true
          components: rustfmt

      - name: Build Leo
        run: |
          cargo build --package leo-lang --release && strip target/release/leo
        env:
          CARGO_NET_GIT_FETCH_WITH_CLI: true

      - id: get_version
        uses: battila7/get-version-action@v2

      - name: Zip
        run: |
          mkdir tempdir
          mv target/release/leo tempdir
          cd tempdir
          zip -r leo-${{ steps.get_version.outputs.version }}-x86_64-apple-darwin.zip leo
          cd ..
          mv tempdir/leo-${{ steps.get_version.outputs.version }}-x86_64-apple-darwin.zip .

      - name: Unzip Project Files
      run: |
        unzip leo.zip -d tmp_leo

    - name: Create PKG File
      run: |
        pkgbuild --root tmp_leo --identifier com.aleo.leo --version ${{ steps.get_version.outputs.version }} leo.pkg

    - name: Decode and Import Apple Developer Certificate
      run: |
        echo "${{ secrets.APPLE_DEVELOPER_CERTIFICATE }}" | base64 --decode > certificate.p12
        security create-keychain -p actions actions.keychain
        security default-keychain -s actions.keychain
        security unlock-keychain -p actions actions.keychain
        security import certificate.p12 -k actions.keychain -P ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_PASSWORD }} -T /usr/bin/codesign
        security set-key-partition-list -S apple-tool:,apple: -s -k actions actions.keychain

    - name: Sign PKG File
      run: |
        productsign --keychain actions.keychain --sign "Developer ID Installer: Austin Harshberger (U572Q4JQ3J)" leo.pkg latest_leo.pkg


      - name: Release
        uses: softprops/action-gh-release@v1
        if: startsWith(github.ref, 'refs/tags/')
        with:
          files: |
            leo.zip
            latest_leo.pkg
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

  macos_m1:
    name: macOS M1
    runs-on: macos-latest
    steps:
      - name: Xcode Select
        uses: devbotsxyz/[email protected]

      - name: Checkout
        uses: actions/checkout@v2

      - name: Install Rust
        uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          target: aarch64-apple-darwin
          toolchain: stable
          override: true
          components: rustfmt

      - name: Build Leo
        run: |
          SDKROOT=$(xcrun -sdk macosx11.1 --show-sdk-path) \
          MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx11.1 --show-sdk-platform-version) \
          cargo build -p leo-lang --release --target=aarch64-apple-darwin --features noconfig && strip target/aarch64-apple-darwin/release/leo
        env:
          CARGO_NET_GIT_FETCH_WITH_CLI: true

      - id: get_version
        uses: battila7/get-version-action@v2

      - name: Zip
        run: |
          mkdir tempdir
          mv target/aarch64-apple-darwin/release/leo tempdir
          cd tempdir
          zip -r leo.zip leo
          cp leo.zip leo-${{ steps.get_version.outputs.version }}-aarch64-apple-darwin.zip
          cd ..
          mv tempdir/leo-${{ steps.get_version.outputs.version }}-aarch64-apple-darwin.zip .
          mv tempdir/leo.zip .

      - name: Release macos m1 version
        uses: softprops/action-gh-release@v1
        if: startsWith(github.ref, 'refs/tags/')
        with:
          files: |
            leo-${{ steps.get_version.outputs.version }}-aarch64-apple-darwin.zip
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

      - name: Release leo.zip
        uses: softprops/action-gh-release@v1
        if: startsWith(github.ref, 'refs/tags/')
        with:
          files: |
            leo.zip
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

  windows:
    name: Windows
    runs-on: windows-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Install Rust
        uses: actions-rs/toolchain@v1
        with:
          profile: minimal
          toolchain: stable
          override: true
          components: rustfmt

      - name: Install LLVM and Clang
        uses: KyleMayes/install-llvm-action@v1
        with:
          version: "11"
          directory: ${{ runner.temp }}/llvm

      - name: Set LIBCLANG_PATH
        run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV

      - name: Build Leo
        run: |
          cargo build --package leo-lang --release --features noconfig
        env:
          CARGO_NET_GIT_FETCH_WITH_CLI: true

      - id: get_version
        uses: battila7/get-version-action@v2

      - name: Zip
        run: |
          Compress-Archive target/release/leo.exe leo-${{ steps.get_version.outputs.version }}-x86_64-pc-windows-msvc.zip

      - name: Release
        uses: softprops/action-gh-release@v1
        if: startsWith(github.ref, 'refs/tags/')
        with:
          files: |
            leo-${{ steps.get_version.outputs.version }}-x86_64-pc-windows-msvc.zip
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

from leo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.