Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build icons workflow #1840

Merged
merged 2 commits into from
Sep 1, 2023
Merged

Conversation

lunatic-fox
Copy link
Contributor

Double check these details before you open a PR

  • PR does not match another non-stale PR currently opened

Features

This PR closes NONE

Notes

Skips imgur_step and removes the lines related to this step on release_message_step. It also uses the last version of Windows, GitHub Checkout, Setup Python and Python on 3.10 version.

Copy link
Member

@Panquesito7 Panquesito7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure we do not need to update other workflows to use newer versions, as done in #1731?

@lunatic-fox
Copy link
Contributor Author

lunatic-fox commented Jul 28, 2023

Are you sure we do not need to update other workflows to use newer versions, as done in #1731?

Well, I do think so, since this action uses geckodriver on a Windows machine and on develop branch geckodriver is referenced to work on an Ubuntu machine.

Probably #1731, should be merged to master before, to have the geckodriver working on Ubuntu, then merge this pull request to master with the following modifications:

name: Build Icons
on: workflow_dispatch
jobs:
  build:
    name: Get Fonts From Icomoon
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      - uses: actions/setup-python@v4
        with: 
          python-version: '3.10'

      - name: Install dependencies (python, pip, npm)
        run: |
          python -m pip install --upgrade pip
          pip install -r ./.github/scripts/requirements.txt
          npm install

      - name: Executing build and create fonts via icomoon
        shell: bash
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: >
          python ./.github/scripts/icomoon_build.py 
          ./.github/scripts/build_assets/geckodriver-v0.32.2-linux64/geckodriver ./icomoon.json 
          ./devicon.json ./icons ./ $GITHUB_TOKEN --headless

      - name: Upload geckodriver.log for debugging purposes
        uses: actions/upload-artifact@v2
        if: failure()
        with:
          name: geckodriver-log
          path: ./geckodriver.log

      - name: Upload log file for debugging purposes
        uses: actions/upload-artifact@v2
        if: always()
        with:
          name: logfile
          path: ./log.txt

      - name: Build devicon.min.css
        if: success() 
        run: npm run build-css

      # - name: Upload screenshot of the newly made icons
      #   id: imgur_step
      #   uses: devicons/[email protected]
      #   if: success()
      #   with:
      #     # will have "new_icons.png" and "new_svgs.png"
      #     # in that order (cause sorted alphabetically)
      #     path: ./screenshots/*.png
      #     client_id: ${{secrets.IMGUR_CLIENT_ID}}

      - name: Get the release message from file
        id: release_message_step
        uses: juliangruber/[email protected]
        with:
          # taken from icomoon_build.py's get_release_message()
          path: ./release_message.txt  

      - name: Create Pull Request
        if: success() 
        uses: peter-evans/create-pull-request@v3
        env:
          MESSAGE: |
            Hello,

            I'm Devicon's Build Bot and I just built some new font files and devicon.min.css file.

            The devicon.min.css file contains:
            -The icon content
            -The aliases
            -The colored classes

            I also compiled a list of new features and icons that were added since last release.
            ```
            {0}
            ```

            More information can be found in the GitHub Action logs for this workflow.

            Adios, 
            Build Bot :sunglasses:
        with:
          branch: 'bot/build-result'
          commit-message: 'Built new icons, icomoon.json and devicon.css'
          title: 'bot:build new icons, icomoon.json and devicon.css'
          body: >
            ${{ 
              format(
                env.MESSAGE,
                steps.release_message_step.outputs.content
              )
            }}
          delete-branch: true

The other way around could be revert the #1731 commit and keep this pull request working on Windows, then after the release, commit again #1731 to change all actions to Ubuntu definitively.

Copy link
Member

@Panquesito7 Panquesito7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! 🚀
Let's test it out.

@Panquesito7 Panquesito7 added devops Use this label for devops related enhancements and removed enhancement labels Sep 1, 2023
@Panquesito7 Panquesito7 merged commit 55609aa into devicons:master Sep 1, 2023
4 checks passed
@Snailedlt Snailedlt mentioned this pull request Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devops Use this label for devops related enhancements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants