Update docker-compose.yml #41
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 and give it a name | |
| on: | |
| push: | |
| branches: | |
| - sudo | |
| env: | |
| OPENAI_MODEL: gpt-4.1 | |
| jobs: | |
| create-release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| packages: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Create a requirements.txt file | |
| run: | | |
| echo "names_generator" > requirements.txt | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| - name: Generate Dockerlike release name | |
| id: dockerlike-release-name | |
| run: | | |
| DOCKERLIKE_RELEASE_NAME=$(python -c "from names_generator import generate_name; print(generate_name())") | |
| echo "DOCKERLIKE_RELEASE_NAME=${DOCKERLIKE_RELEASE_NAME}" >> $GITHUB_ENV | |
| - name: Get latest version | |
| id: get_version | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| # Get the latest version tag | |
| LATEST_TAG=$(git tag --sort=-version:refname | head -n1 || echo "v0.0.0") | |
| # Increment patch version | |
| MAJOR=$(echo $LATEST_TAG | cut -d. -f1) | |
| MINOR=$(echo $LATEST_TAG | cut -d. -f2) | |
| PATCH=$(echo $LATEST_TAG | cut -d. -f3) | |
| NEW_PATCH=$((PATCH + 1)) | |
| NEW_VERSION="${MAJOR}.${MINOR}.${NEW_PATCH}" | |
| echo "NEW_VERSION=${NEW_VERSION}" >> $GITHUB_ENV | |
| - name: Get commits | |
| id: get_commits | |
| shell: sh | |
| run: | | |
| git fetch --tags | |
| LAST_TAG=$(git tag --sort=-version:refname | head -n1 || echo "v0.0.0") | |
| COMMITS=$(git log --oneline --no-merges --pretty=format:"%s" ${LAST_TAG}..HEAD) | |
| COMMITS=$(echo "$COMMITS" | tr '\n' ';') | |
| echo "ALL_COMMITS=$COMMITS" >> $GITHUB_ENV | |
| - name: Generate Release notes | |
| id: generate-release-notes | |
| shell: sh | |
| env: | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| OPENAI_BASE_URL: ${{ secrets.OPENAI_BASE_URL }} | |
| DOCKERLIKE_RELEASE_NAME: ${{ env.DOCKERLIKE_RELEASE_NAME }} | |
| NEW_VERSION: ${{ env.NEW_VERSION }} | |
| COMMITS: ${{ env.ALL_COMMITS }} | |
| run: | | |
| echo "Generating release notes..." | |
| python3 scripts/generate-release-notes.py ${{ env.OPENAI_MODEL }} | |
| echo "Release notes generated" | |
| - name: Create a Release | |
| uses: softprops/action-gh-release@v2 | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| name: ${{ env.DOCKERLIKE_RELEASE_NAME }} | |
| tag_name: ${{ env.NEW_VERSION }} | |
| body_path: release_notes.md |