wip: move smart_iter to its own module #28
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: Build | |
| on: [push] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Source | |
| id: checkout-source | |
| uses: actions/checkout@v2 | |
| - name: Set variables | |
| id: vars | |
| run: | | |
| echo "::set-output name=package_name::$(sed -En 's/name[[:space:]]*=[[:space:]]*"([^"]+)"/\1/p' Cargo.toml | head -1)" | |
| echo "::set-output name=package_version::$(sed -En 's/version[[:space:]]*=[[:space:]]*"([^"]+)"/\1/p' Cargo.toml | head -1)" | |
| - run: | | |
| echo "${{steps.vars.outputs.package_name}}" | |
| echo "${{steps.vars.outputs.package_version}}" | |
| - uses: actions/cache@v4.2.0 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Build | |
| id: build-release | |
| run: cargo build --release | |
| - name: Zip release | |
| id: zip-release | |
| run: zip -j build.zip target/release/codeinput | |
| - name: Artifact Production | |
| id: create-artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build | |
| path: build.zip | |
| - name: Remove Same Release | |
| uses: omarabid-forks/action-rollback@stable | |
| continue-on-error: true | |
| with: | |
| tag: ${{ steps.vars.outputs.package_version }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create Release | |
| id: create-release | |
| uses: actions/create-release@latest | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | |
| with: | |
| tag_name: ${{steps.vars.outputs.package_version}} | |
| release_name: Version ${{steps.vars.outputs.package_version}} | |
| body: ${{steps.vars.outputs.package_name}} - ${{steps.vars.outputs.package_version}} | |
| draft: false | |
| prerelease: false | |
| - name: Upload Artifact | |
| id: upload-release-asset | |
| uses: actions/upload-release-asset@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| upload_url: ${{ steps.create-release.outputs.upload_url }} | |
| asset_path: build.zip | |
| asset_name: build.zip | |
| asset_content_type: application/zip | |
| - uses: omarabid-forks/purge-artifacts@v1 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| expire-in: 0 |