updated the dwm config

This commit is contained in:
Sohrab Behdani 2023-09-23 12:47:12 +03:30
parent 630d526796
commit be3334fd6f
2 changed files with 24 additions and 19 deletions

View file

@ -1,16 +1,14 @@
# This workflow will build an Arch Linux ISO file with the commit on it
# This workflow will build an Arch Linux ISO file when a release is created.
name: build parchiso per release
on:
release:
types:
- created
env:
api_key: ${{ secrets.GITHUB_TOKEN }}
name: ${{ github.event.repository.name }}
release_name: ${{ github.ref_name }}
jobs:
build:
permissions:
contents: write
runs-on: ubuntu-latest
container:
image: archlinux:latest
@ -18,11 +16,18 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Install Packages via Pacman
run: pacman -Sy; pacman --noconfirm -S git archiso python python-pygithub reflector
- name: Change Arch docker mirror
run: reflector -c "US" -f 12 -l 10 -n 12 --save /etc/pacman.d/mirrorlist
run: |
pacman -Suy --noconfirm --noprogressbar
pacman -Sy --noconfirm --noprogressbar --needed git archiso python python-pygithub reflector
- name: Change pacman mirrors
run: |
reflector -n 3 --protocol https --save /etc/pacman.d/mirrorlist
pacman -Syy
- name: Build image
run: mkarchiso -v iso/
- name: Upload iso to the release
env:
API_KEY: ${{ secrets.GITHUB_TOKEN }}
REPO_NAME: ${{ github.repository }}
RELEASE_NAME: ${{ github.ref_name }}
run: python tools/upload_asset.py

View file

@ -9,7 +9,7 @@ from github import Github
logging.basicConfig(level=logging.INFO, format="%(levelname)s: %(message)s")
api_key = os.getenv("api_key", None)
api_key = os.getenv("API_KEY", None)
current_date = datetime.today().strftime("%Y-%m-%d")
@ -28,29 +28,29 @@ file_name = _path.name
hash = _compute_sha256(path)
repo_name = os.getenv("name", None)
release_name = os.getenv("release_name", None)
repo_name = os.getenv("REPO_NAME", None)
release_name = os.getenv("RELEASE_NAME", None)
logging.info("Starting at %s", current_date)
if not (repo_name and api_key and release_name):
logging.error(
"'repo_name'/'api_key'/'release_name' not found in your envs."
"please add this and run again"
"'REPO_NAME'/'API_KEY'/'RELEASE_NAME' not found in your environment vars."
"please add this and run again."
)
sys.exit(1)
gh = Github(api_key)
print(repo_name, api_key)
repo = gh.get_repo(f"parchlinux/{repo_name}")
repo = gh.get_repo(repo_name)
release = repo.get_release(release_name)
logging.info("statrting Upload ISO to release")
logging.info("Statrting upload ISO to release")
release.upload_asset(path=path)
logging.info("ISO upload is done")
logging.info("ISO uploaded.")
# update release
msg = (
@ -60,6 +60,6 @@ msg = (
| :---: | :---: |
| {file_name} | {hash} |"""
)
logging.info("Starting Update release msg with: \n %s" % msg)
logging.info("Starting update release msg with: \n %s" % msg)
release.update_release(name=release.tag_name, message=msg)
logging.info("Release Update is done.")
logging.info("Release update is done.")