feat: update release workflow to Portuguese and bump version to 0.2.3… #9
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: Create Release | |
| on: | |
| push: | |
| branches: [ main ] | |
| paths: | |
| - 'src/**' | |
| - 'Cargo.toml' | |
| - 'Cargo.lock' | |
| - '.github/workflows/create-release.yml' | |
| jobs: | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: 1.90.0 | |
| - name: Cache Rust dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Run tests | |
| run: | | |
| cargo test | |
| build: | |
| name: Build and Release | |
| runs-on: ubuntu-latest | |
| needs: test | |
| strategy: | |
| matrix: | |
| target: | |
| - x86_64-unknown-linux-gnu | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| toolchain: 1.90.0 | |
| targets: ${{ matrix.target }} | |
| - name: Cache Rust dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Build release binary | |
| run: | | |
| cargo build --release --target ${{ matrix.target }} | |
| - name: Package Linux binary | |
| run: | | |
| cd target/${{ matrix.target }}/release | |
| tar czf procon-cli-${{ matrix.target }}.tar.gz procon-cli | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: procon-cli-${{ matrix.target }} | |
| path: target/${{ matrix.target }}/release/*.tar.gz | |
| create-release: | |
| name: Create GitHub Release | |
| runs-on: ubuntu-latest | |
| needs: build | |
| if: github.ref == 'refs/heads/main' | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Get version from Cargo.toml | |
| id: get_version | |
| run: | | |
| VERSION=$(grep '^version =' Cargo.toml | sed 's/version = "\(.*\)"/\1/') | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: v${{ steps.get_version.outputs.version }} | |
| name: v${{ steps.get_version.outputs.version }} | |
| body: | | |
| ## 📦 v${{ steps.get_version.outputs.version }} | |
| ### 🚀 Como Usar | |
| ```bash | |
| # Gera a lista no formato adblock | |
| ./procon-cli generate --output adblock.txt | |
| # Gera a lista no formato hosts | |
| ./procon-cli generate --format hosts --output hosts.txt | |
| ``` | |
| files: artifacts/**/* | |
| draft: false | |
| prerelease: false | |
| make_latest: true | |
| generate_release_notes: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |