-
-
Notifications
You must be signed in to change notification settings - Fork 0
ci: rewrite our infrastructure #42
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
Changes from all commits
3bde396
8641bd1
9949e72
794cb4d
f116708
e7086f8
de47358
0edd701
b14c3eb
f38303a
cdc67c4
78ac145
7fc691a
8cec6bb
a4e472e
5dd52bb
c87166a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| name: '[build] flatpak validation' | ||
| name: '[build] bundle validation' | ||
|
|
||
| on: | ||
| workflow_call: | ||
|
|
@@ -9,6 +9,8 @@ on: | |
| paths-ignore: | ||
| - 'po/**' | ||
| push: | ||
| tags: | ||
| - 'v*' | ||
| branches: | ||
| - main | ||
| paths-ignore: | ||
|
|
@@ -18,39 +20,6 @@ permissions: | |
| contents: read | ||
|
|
||
| jobs: | ||
| i18n-update: | ||
| name: '[build] update translations' | ||
| runs-on: ubuntu-latest | ||
| if: github.event_name == 'pull_request' && github.event_name != 'workflow_call' | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 1 | ||
|
|
||
| - name: Install system dependencies | ||
| run: sudo apt-get update && sudo apt-get install -y meson ninja-build gjs | ||
|
|
||
| - name: Setup Project | ||
| uses: ./.github/actions/setup-project | ||
| with: | ||
| setup-node: 'true' | ||
|
|
||
| - name: Update POT files | ||
| run: yarn pot-generator | ||
|
|
||
| - name: Commit changes | ||
| uses: stefanzweifel/git-auto-commit-action@b863ae1933cb653a53c021fe36dbb774e1fb9403 | ||
| with: | ||
| commit_message: 'lang: update pot files' | ||
| file_pattern: 'po/*.po po/*.pot' | ||
|
|
||
| - name: Clean up credentials | ||
| if: always() | ||
| run: | | ||
| rm -rf ~/.gnupg ~/.gnupg/private-keys-v1.d || true | ||
| find ~/.gnupg -delete 2>/dev/null || true | ||
|
|
||
| bundle-prod: | ||
| name: '[build] validate prod bundle' | ||
| runs-on: ubuntu-latest | ||
|
|
@@ -67,7 +36,7 @@ jobs: | |
| fetch-depth: 1 | ||
|
|
||
| - name: Setup Project | ||
| uses: ./.github/actions/setup-project | ||
| uses: andrepg/do-it/.github/actions/setup-project | ||
| with: | ||
| setup-node: 'true' | ||
|
|
||
|
|
@@ -100,7 +69,7 @@ jobs: | |
| fetch-depth: 1 | ||
|
|
||
| - name: Setup Project | ||
| uses: ./.github/actions/setup-project | ||
| uses: andrepg/do-it/.github/actions/setup-project | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| with: | ||
| setup-node: 'true' | ||
|
|
||
|
|
@@ -116,8 +85,3 @@ jobs: | |
| run: | | ||
| rm -rf ~/.gnupg ~/.gnupg/private-keys-v1.d || true | ||
| find ~/.gnupg -delete 2>/dev/null || true | ||
|
|
||
| test-and-coverage: | ||
| name: '[build] test and coverage' | ||
| if: github.event_name != 'workflow_call' | ||
| uses: ./.github/workflows/test-coverage.yml | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,7 +20,7 @@ env: | |
|
|
||
| jobs: | ||
| flatpak-validation: | ||
| uses: ./.github/workflows/flatpak-bundle-validation.yml | ||
| uses: ./.github/workflows/bundle-validation.yml | ||
|
|
||
| flatpak-bundle: | ||
| name: '[build] create flatpak bundle' | ||
|
|
@@ -37,8 +37,15 @@ jobs: | |
| with: | ||
| fetch-depth: 1 | ||
|
|
||
| - name: Checkout flatpak keys | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| sparse-checkout: | | ||
| flatpak/io.github.andrepg.Doit-latest.pub | ||
|
qltysh[bot] marked this conversation as resolved.
|
||
| sparse-checkout-cone-mode: false | ||
|
|
||
| - name: Setup Project | ||
| uses: ./.github/actions/setup-project | ||
| uses: andrepg/do-it/.github/actions/setup-project | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| - name: Setup GPG | ||
| run: | | ||
|
|
@@ -72,16 +79,48 @@ jobs: | |
|
|
||
| - name: Generate flatpakref | ||
| run: | | ||
| cat << 'FLATPAKREF' > "${{ env.FLATPAK_NAME }}-latest.flatpakref" | ||
| # Import separate public key for distribution (not the signing key) | ||
| gpg --batch --yes --import flatpak/io.github.andrepg.Doit-latest.pub | ||
|
|
||
| # Filter by email to get specific key fingerprint | ||
| DIST_KEY_FP=$(gpg --list-public-keys --with-colons "andrepg@protonmail.com" 2>/dev/null | grep "^fpr" | cut -d: -f10) | ||
|
|
||
| # Validate fingerprint was extracted | ||
| if [ -z "$DIST_KEY_FP" ]; then | ||
| echo "ERROR: No key found for andrepg@protonmail.com" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Export as BINARY (no --armor!), then base64 encode | ||
| GPG_PUB_KEY=$(gpg --export "$DIST_KEY_FP" | base64 -w0) | ||
|
|
||
| # Validate base64 output is not empty | ||
| if [ -z "$GPG_PUB_KEY" ]; then | ||
| echo "ERROR: Failed to export or encode GPG key" | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Generate flatpakref with base64-encoded key | ||
| cat << FLATPAKREF > "${{ env.FLATPAK_NAME }}-latest.flatpakref" | ||
| [Flatpak Ref] | ||
| Title=Do It | ||
| Name=${{ env.FLATPAK_NAME }} | ||
| Branch=main | ||
| Url=https://github.com/${{ github.repository }}/releases/download/${{ env.RELEASE_TAG }}/${{ env.FLATPAK_NAME }}-latest.flatpak | ||
| IsRuntime=False | ||
| GPGKey=${{ secrets.FLATPAK_GPG_KEY }} | ||
| GPGKey=$GPG_PUB_KEY | ||
| FLATPAKREF | ||
|
|
||
| - name: Verify flatpakref GPGKey format | ||
| run: | | ||
| # Use robust grep without anchor for INI file format | ||
| GPG_KEY_VAL=$(grep "GPGKey=" "${{ env.FLATPAK_NAME }}-latest.flatpakref" | cut -d= -f2) | ||
| if ! echo "$GPG_KEY_VAL" | base64 -d >/dev/null 2>&1; then | ||
| echo "ERROR: GPGKey is not valid base64" | ||
| exit 1 | ||
| fi | ||
| echo "Verified: GPGKey is valid base64" | ||
|
|
||
| - name: Upload bundle to release | ||
| uses: softprops/action-gh-release@v2 | ||
| with: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| name: '[build] i18n update' | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: ['main'] | ||
| paths: | ||
| - 'src/**' | ||
| - 'package.json' | ||
| - 'yarn.lock' | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| jobs: | ||
| i18n-update: | ||
| name: '[build] update translations' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Setup Project | ||
| uses: andrepg/do-it/.github/actions/setup-project | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| with: | ||
| setup-node: 'true' | ||
| setup-system-deps: 'true' | ||
| meson-version: '1.4.0' | ||
|
|
||
| - name: Update POT files | ||
| run: yarn pot-generator | ||
|
|
||
| - name: Create new branch for translations | ||
| run: | | ||
| git checkout -b "i18n-update/$(git rev-parse --short HEAD)" | ||
|
|
||
| - name: Commit changes | ||
| uses: stefanzweifel/git-auto-commit-action@b863ae1933cb653a53c021fe36dbb774e1fb9403 | ||
| with: | ||
| commit_message: 'lang: update pot files' | ||
| file_pattern: 'po/*.po po/*.pot' | ||
|
|
||
| - name: Create PR | ||
| if: github.event_name == 'pull_request' | ||
| run: | | ||
| BRANCH_NAME="i18n-update/$(git rev-parse --short HEAD)" | ||
| git push -u origin "$BRANCH_NAME" | ||
| gh pr create --base "$GITHUB_REF_NAME" --head "$BRANCH_NAME" \ | ||
| --title "lang: update pot files" \ | ||
| --body "Automated POT file update from i18n-update workflow" | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,11 +12,8 @@ jobs: | |
| runs-on: ubuntu-latest | ||
| continue-on-error: true | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Setup Project | ||
| uses: ./.github/actions/setup-project | ||
| uses: andrepg/do-it/.github/actions/setup-project | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| with: | ||
| setup-node: 'true' | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ | |
| repo/ | ||
|
|
||
| **/_build | ||
| **/build | ||
| **/_build-*/** | ||
| **/_repo-*/** | ||
| **/*.json~ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,3 +6,4 @@ _build_pot | |
| flatpak/generated-sources.json | ||
| package-lock.json | ||
| **.code-workspace | ||
| build | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,6 +13,7 @@ export default defineConfig([ | |
| '.github/**', | ||
|
|
||
| '.vscode/**', | ||
| '.opencode/**', | ||
|
|
||
| 'flatpak/**', | ||
| 'tests/**', | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
specifying action "andrepg/do-it/.github/actions/setup-project" in invalid format because ref is missing. available formats are "{owner}/{repo}@{ref}" or "{owner}/{repo}/{path}@{ref}" [actionlint:action]