Automatic Winget Package Manifest Creation and Submission #982
This file contains 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
# This is a basic workflow to help you get started with Actions | |
name: Automatic Winget Package Manifest Creation and Submission | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push or pull request events but only for the "main" branch | |
push: | |
# branches: [ "main" ] | |
pull_request: | |
# branches: [ "main" ] | |
schedule: | |
- cron: "0 */3 * * *" | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Install Python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install polars numpy requests pyyaml | |
- name: Install Linux dependencies | |
run: | | |
wget "https://github.com/russellbanks/Komac/releases/download/v2.1.0/komac_2.1.0-1_amd64.deb" | |
sudo dpkg -i komac_2.1.0-1_amd64.deb | |
komac -v | |
- name: Git Clone & Check microsoft/winget-pkgs listing | |
env: | |
GH_TOKEN: ${{ secrets.token }} | |
run: | | |
git clone --branch "master" https://github.com/microsoft/winget-pkgs.git | |
gh pr list --repo "microsoft/winget-pkgs" --state "open" --limit 10000000 > 'data/OpenPRs.txt' | |
- name: Python Scripts | |
env: | |
TOKEN: ${{ secrets.TOKEN }} | |
run: | | |
python OpenPRs.py | |
python ExtractPackageName.py | |
python ExtractGitHubReleases.py | |
- name: Python run | |
env: | |
TOKEN: ${{ secrets.TOKEN }} | |
run: | | |
python FindLatestVer.py | |
- name: PRs Creation | |
env: | |
TOKEN: ${{ secrets.TOKEN }} | |
run: | | |
python CreatePRs.py | |
chmod +x komac_commands.sh | |
ls -l | |
rm komac_commands.sh | |
rm komac_2.1.0-1_amd64.deb | |
ls -l | |
- name: 🚀 Commit and push if it changed | |
run: | | |
git config user.name "${GITHUB_ACTOR}" | |
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
git add -A | |
timestamp=$(date -u) | |
git commit -m "Latest data: ${timestamp}" || exit 0 | |
git push |