Cache parsed package info in nimblemeta.json to avoid re-parsing inst… #1562
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| on: | |
| push: | |
| tags: | |
| - "v*" # "v1.2.3" | |
| branches: | |
| - master | |
| paths-ignore: ["nimble-guide/**", "**/*.md"] | |
| pull_request: | |
| paths-ignore: ["nimble-guide/**", "**/*.md"] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| target: | |
| - os: linux | |
| triple: x86_64-linux-musl | |
| name: linux_x64 | |
| - os: linux | |
| triple: i686-linux-musl | |
| name: linux_x32 | |
| - os: linux | |
| triple: aarch64-linux-musl | |
| name: linux_aarch64 | |
| - os: linux | |
| triple: armv7l-linux-musleabihf | |
| name: linux_armv7l | |
| - os: macosx | |
| triple: x86_64-apple-darwin14 | |
| name: macosx_x64 | |
| - os: macosx | |
| triple: aarch64-apple-darwin | |
| name: macosx_aarch64 | |
| - os: macosx | |
| triple: universal-apple-darwin | |
| name: macosx_universal | |
| - os: windows | |
| triple: x86_64-w64-mingw32 | |
| name: windows_x64 | |
| - os: windows | |
| triple: i686-w64-mingw32 | |
| name: windows_x32 | |
| include: | |
| - target: | |
| os: linux | |
| builder: ubuntu-22.04 | |
| - target: | |
| os: macosx | |
| builder: macos-14 | |
| - target: | |
| os: windows | |
| builder: windows-2025 | |
| defaults: | |
| run: | |
| shell: bash | |
| name: "${{ matrix.target.triple }}" | |
| runs-on: ${{ matrix.builder }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| submodules: recursive | |
| - uses: jiro4989/setup-nim-action@v2 | |
| with: | |
| nim-version: "stable" | |
| yes: true | |
| - name: Install dependencies | |
| run: nimble install -y | |
| - name: Install zip | |
| if: matrix.target.os == 'windows' | |
| run: choco install zip | |
| - name: build nimble | |
| run: | | |
| if [[ "${{ matrix.target.triple }}" == "x86_64-apple-darwin14" ]]; then | |
| nim c -d:release \ | |
| -d:zippyNoSimd \ | |
| --passL:"-target x86_64-apple-macos10.15" \ | |
| --passC:"-target x86_64-apple-macos10.15" \ | |
| src/nimble.nim; | |
| elif [[ "${{ matrix.target.triple }}" == "aarch64-apple-darwin" ]]; then | |
| nim c -d:release \ | |
| -d:zippyNoSimd \ | |
| --passL:"-target arm64-apple-macos11" \ | |
| --passC:"-target arm64-apple-macos11" \ | |
| src/nimble.nim; | |
| elif [[ "${{ matrix.target.triple }}" == "universal-apple-darwin" ]]; then | |
| nim c -d:release \ | |
| -d:zippyNoSimd \ | |
| --passL:"-target x86_64-apple-macos10.15" \ | |
| --passC:"-target x86_64-apple-macos10.15" \ | |
| -o:src/nimble_x64 src/nimble.nim; | |
| nim c -d:release \ | |
| -d:zippyNoSimd \ | |
| --passL:"-target arm64-apple-macos11" \ | |
| --passC:"-target arm64-apple-macos11" \ | |
| -o:src/nimble_arm64 src/nimble.nim; | |
| lipo -create src/nimble_x64 src/nimble_arm64 -output src/nimble; | |
| else | |
| nim -d:release c src/nimble.nim; | |
| fi | |
| - name: Download OpenSSL DLLs | |
| if: matrix.target.os == 'windows' | |
| run: | | |
| curl -sL "https://nim-lang.org/download/dlls.zip" -o dlls.zip | |
| unzip -o dlls.zip -d src/ "libcrypto-*.dll" "libssl-*.dll" "cacert.pem" | |
| - name: Compress binaries | |
| run: | | |
| cd src | |
| if [[ "${{ matrix.target.os }}" == "windows" ]]; then | |
| # Create both formats for Windows (include OpenSSL DLLs) | |
| tar -c -z -v -f ../nimble-${{ matrix.target.name }}.tar.gz nimble.exe libcrypto-*.dll libssl-*.dll cacert.pem | |
| zip ../nimble-${{ matrix.target.name }}.zip nimble.exe libcrypto-*.dll libssl-*.dll cacert.pem | |
| else | |
| tar -c -z -v -f ../nimble-${{ matrix.target.name }}.tar.gz nimble | |
| fi | |
| - name: Upload tar.gz artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: nimble-${{ matrix.target.name }}.tar.gz | |
| path: nimble-${{ matrix.target.name }}.tar.gz | |
| - name: Upload zip artifact (Windows only) | |
| if: matrix.target.os == 'windows' | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: nimble-${{ matrix.target.name }}.zip | |
| path: nimble-${{ matrix.target.name }}.zip | |
| create-github-release: | |
| if: github.event_name != 'pull_request' | |
| name: Create GitHub Release | |
| needs: [build] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| actions: write | |
| steps: | |
| - name: Download artefacts | |
| uses: actions/download-artifact@v8 | |
| # Create/update the "latest" release | |
| - uses: ncipollo/release-action@v1 | |
| with: | |
| name: Latest Nimble Binaries | |
| artifacts: "*/*" | |
| allowUpdates: true | |
| makeLatest: true | |
| prerelease: true | |
| tag: latest | |
| # Generate release notes and create a versioned release if this is a tag push | |
| - if: startsWith(github.ref, 'refs/tags/v') | |
| name: Generate release notes | |
| id: release_notes | |
| uses: actions/github-script@v8 | |
| with: | |
| script: | | |
| const { data: releaseNotes } = await github.rest.repos.generateReleaseNotes({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| tag_name: context.ref.replace('refs/tags/', ''), | |
| target_commitish: context.sha, | |
| }); | |
| core.setOutput('notes', releaseNotes.body) | |
| - if: startsWith(github.ref, 'refs/tags/v') | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| name: Nimble ${{ github.ref_name }} | |
| artifacts: "*/*" | |
| allowUpdates: true | |
| makeLatest: false | |
| prerelease: false | |
| draft: true | |
| tag: ${{ github.ref_name }} | |
| body: ${{ steps.release_notes.outputs.notes }} | |
| - name: Delete artefacts | |
| uses: geekyeggo/delete-artifact@v6 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| failOnError: false | |
| name: "nimble-*" |