Merge pull request #360 from code0-tech/feat/#359 #53
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: Publish YML | |
| on: | |
| push: | |
| tags: | |
| - '*' | |
| jobs: | |
| publish-defintions: | |
| permissions: | |
| contents: write | |
| packages: read | |
| if: startsWith(github.ref, 'refs/tags/def-') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v6 | |
| - name: Set script permissions | |
| run: chmod +x ./scripts/inject-version.sh | |
| - name: Inject version | |
| run: | | |
| VERSION="${{ github.ref_name }}" | |
| VERSION="${VERSION#*-}" # removes everything up to the first dash | |
| ./scripts/inject-version.sh "$VERSION" | |
| - name: Archive definitions folder | |
| run: | | |
| zip -r definitions.zip definitions | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| name: Release ${{ github.ref_name }} | |
| files: | | |
| definitions.zip | |
| generate_release_notes: true | |
| make_latest: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GH_RELEASE_TOKEN }} | |
| publish-cli: | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/cli-') | |
| defaults: | |
| run: | |
| working-directory: "./crates/cli" | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v6 | |
| - name: Set version | |
| run: | | |
| VERSION=$(echo "${{ github.ref_name }}" | sed 's/^cli-//') | |
| sed -i "s/version = \"0.0.0\"/version = \"$VERSION\"/" Cargo.toml | |
| - name: Cargo Login | |
| run: cargo login ${{secrets.CRATES_IO_PUBLISH}} | |
| - name: Publish crate | |
| run: cargo publish --allow-dirty |