feat: add --light flag for markdown-like list output #20
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
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: write | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| build: | |
| name: Build ${{ matrix.target }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - target: x86_64-unknown-linux-gnu | |
| os: ubuntu-22.04 | |
| artifact: facts-linux-amd64 | |
| - target: aarch64-unknown-linux-gnu | |
| os: ubuntu-22.04 | |
| artifact: facts-linux-arm64 | |
| - target: x86_64-apple-darwin | |
| os: macos-latest | |
| artifact: facts-darwin-amd64 | |
| - target: aarch64-apple-darwin | |
| os: macos-latest | |
| artifact: facts-darwin-arm64 | |
| - target: x86_64-pc-windows-msvc | |
| os: windows-latest | |
| artifact: facts-windows-amd64 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Install cross-compilation tools (Linux ARM64) | |
| if: matrix.target == 'aarch64-unknown-linux-gnu' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y gcc-aarch64-linux-gnu | |
| echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV | |
| - name: Build | |
| run: cargo build --release --target ${{ matrix.target }} | |
| - name: Package (Unix) | |
| if: runner.os != 'Windows' | |
| run: | | |
| cd target/${{ matrix.target }}/release | |
| tar czf ../../../${{ matrix.artifact }}.tar.gz facts | |
| cd ../../.. | |
| - name: Package (Windows) | |
| if: runner.os == 'Windows' | |
| run: | | |
| cd target/${{ matrix.target }}/release | |
| 7z a ../../../${{ matrix.artifact }}.zip facts.exe | |
| cd ../../.. | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.artifact }} | |
| path: ${{ matrix.artifact }}.* | |
| release: | |
| name: Create Release | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Create release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| generate_release_notes: true | |
| files: | | |
| artifacts/**/*.tar.gz | |
| artifacts/**/*.zip | |
| publish-npm: | |
| name: Publish to NPM | |
| needs: release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "24" | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Set version from tag | |
| run: | | |
| VERSION="${GITHUB_REF_NAME#v}" | |
| cd npm | |
| npm version "$VERSION" --no-git-tag-version --allow-same-version | |
| - name: Prepare README | |
| run: | | |
| cp README.md npm/README.md | |
| sed -i '/github\.com\/user-attachments\/assets/d' npm/README.md | |
| sed -i 's|src="assets/|src="https://raw.githubusercontent.com/av/facts/main/assets/|g' npm/README.md | |
| - name: Publish | |
| run: npm publish --access public --provenance | |
| working-directory: npm | |
| publish-pypi: | |
| name: Publish to PyPI | |
| needs: release | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install build tools | |
| run: pip install build | |
| - name: Set version from tag | |
| run: | | |
| VERSION="${GITHUB_REF_NAME#v}" | |
| cd pypi | |
| sed -i "s/^version = .*/version = \"$VERSION\"/" pyproject.toml | |
| sed -i "s/^VERSION = .*/VERSION = \"$VERSION\"/" setup.py | |
| - name: Prepare README | |
| run: | | |
| cp README.md pypi/README.md | |
| sed -i '/github\.com\/user-attachments\/assets/d' pypi/README.md | |
| sed -i 's|src="assets/|src="https://raw.githubusercontent.com/av/facts/main/assets/|g' pypi/README.md | |
| - name: Build sdist | |
| run: python -m build --sdist | |
| working-directory: pypi | |
| - name: Publish | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| packages-dir: pypi/dist/ |