Skip to content

Add New Build and Automated Release Workflow, Eliminating Dependence on External Update Servers#271

Merged
cary-rowen merged 5 commits into
blindpandas:developfrom
cary-rowen:NewBuildWorkflow
Sep 21, 2024
Merged

Add New Build and Automated Release Workflow, Eliminating Dependence on External Update Servers#271
cary-rowen merged 5 commits into
blindpandas:developfrom
cary-rowen:NewBuildWorkflow

Conversation

@cary-rowen

Copy link
Copy Markdown
Collaborator

Link to issue number:

None

Description

This Pull Request introduces significant enhancements to the project's automation processes by updating the GitHub Actions workflow and refining the invoke commands. The primary objectives and changes include:

Key Changes

  1. Automated Generation of update_info.json

    • Purpose: Bookworm requires an update_info.json file to provide necessary update information, including the update bundle, its corresponding hash, and download URL.
    • Implementation: This PR introduces the invoke gen-update-info-file command to automatically generate the update_info.json file, ensuring consistency and reducing manual intervention.
  2. Transition from External Update Server to GitHub Repository

    • Previous Approach: Previously, the update_info.json was hosted on an external server to provide update information.
    • New Approach: Now, the update_info.json file is placed directly in the main branch of the GitHub repository. When a new version is promoted from draft to official release, the automated workflow submits this file as a Pull Request. To maintain control and ensure accuracy, the PR requires manual merging.
  3. Build Enhancements

    • Multi-Architecture Support: The workflow is configured to build the project for both x86 and x64 architectures using a matrix strategy, ensuring comprehensive compatibility.
    • Dependency Caching: Improved caching mechanisms for Python virtual environments and project resources to accelerate build times.
    • Artifact Management: Enhanced steps for uploading build artifacts, including installers, portable versions, update bundles, translation catalogs, and release information.
  4. Error Handling and Security Improvements

    • Robust Error Handling: Added try-catch blocks in PowerShell scripts to gracefully handle failures during asset fetching and downloading.
    • Secure Token Management: Utilizes GitHub Secrets (PAT_TOKEN) securely to manage authentication for downloading assets and creating pull requests, preventing exposure of sensitive information.

Known Issues

  • Token Permissions: Due to permission constraints, we are unable to use GitHub's default GITHUB_TOKEN. Instead, a separate Personal Access Token (PAT) has been created and is used for this workflow. Specifically, the GITHUB_TOKEN cannot access assets in draft status, necessitating the use of the PAT to handle asset downloads and submissions effectively.

…nfo.json in the main branch after the new version changes from draft to public release.

- Add comments for workflow configuration.
- Workflow is built on Windows and may change in the future.
@cary-rowen

Copy link
Copy Markdown
Collaborator Author

Hi @pauliyobo
You may want to review this PR.

@mush42
You may need to create a PAT(Personal Access Token) for GitHub Action workflow.
PAT requires 'repo' permission.

@cary-rowen
cary-rowen marked this pull request as draft September 19, 2024 11:19
@cary-rowen
cary-rowen marked this pull request as ready for review September 19, 2024 11:19
@mush42

mush42 commented Sep 19, 2024

Copy link
Copy Markdown
Collaborator

@cary-rowen
Good work!
do I need to give you any additional permissions to get this done?

@cary-rowen

Copy link
Copy Markdown
Collaborator Author

Hi @mush42
I don't know what permissions a collaborator needs to do the following, the steps below are just for reference.

Here’s a simplified and concise guide to creating a GitHub Personal Access Token (PAT) with only repo permissions for use in GitHub Actions, with links for quick navigation. The token will be named PAT_TOKEN.

Step 1: Create a Personal Access Token (PAT)

  1. Log in to GitHub: Go to GitHub.
  2. Navigate to Developer Settings:
    • Click on your profile icon in the upper right corner.
    • Go to Settings > Developer settings: Developer settings.
  3. Go to Personal Access Tokens:
  4. Generate New Token:
    • Click Generate new token (classic).
    • Give your token a name (e.g., PAT for GitHub Actions).
    • Set Permissions: Check the box for repo to grant repository access.
    • Optional: Set an expiration date or leave it with No expiration.
    • Click Generate token and copy the token immediately.

Step 2: Add PAT to GitHub Secrets

  1. Go to Repository Settings:
  2. Add Secret:
    • Click Secrets and variables > Actions: GitHub Secrets.
    • Click New repository secret.
    • Name the secret PAT_TOKEN.
    • Paste the copied token into the Secret field.
    • Click Add secret.

@cary-rowen

Copy link
Copy Markdown
Collaborator Author

Hi @mush42
In order to configure GitHub Secrets for the bookworm repository, I need admin access to the repository. Currently, with only write access, I can't access the repository's Settings , which is necessary for adding or managing secrets.
If you could grant me admin access , I would be able to access the settings and make the necessary changes for the GitHub Actions configuration.
However, if you would prefer to handle these settings yourself, that would be even better. Thanks

@mush42

mush42 commented Sep 20, 2024

Copy link
Copy Markdown
Collaborator

@cary-rowen doing it now.

@mush42

mush42 commented Sep 20, 2024

Copy link
Copy Markdown
Collaborator

@cary-rowen please check your role.

@cary-rowen cary-rowen closed this Sep 21, 2024
@cary-rowen cary-rowen reopened this Sep 21, 2024
@cary-rowen

Copy link
Copy Markdown
Collaborator Author

Thanks @mush42 Looks like I have permission,
To merge it for now, I'd like to try the github token first to see if it's valid under that repository.

@cary-rowen
cary-rowen merged commit 75ee268 into blindpandas:develop Sep 21, 2024
@cary-rowen

Copy link
Copy Markdown
Collaborator Author

Hi @mush42

Happily, I discovered that we can directly utilize GITHUB's default TOKEN without using PAT, however this was not possible when I tested it in my own forked repo.
But anyway, it currently works as expected, which is great.
#272 is a Pull Request automatically created by CI to provide new version updates.

@cary-rowen
cary-rowen deleted the NewBuildWorkflow branch January 8, 2026 05:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants