Skip to content

Commit

Permalink
remove assets from main
Browse files Browse the repository at this point in the history
  • Loading branch information
Shane Osbourne committed Nov 8, 2024
1 parent 0cdcce5 commit 47bc86a
Show file tree
Hide file tree
Showing 198 changed files with 231 additions and 41,339 deletions.
126 changes: 126 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
name: PR Build and Release

on:
pull_request:
types: [opened, synchronize, closed, ready_for_review]

permissions: write-all

jobs:
build:
if: github.event.action != 'closed'
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Use Node.js from .nvmrc
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
run: npm ci --verbose

- name: Run build
run: npm run build

- name: Create and push release branch
id: create_branch
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git checkout -b pr-releases/pr-${PR_NUMBER}
git add -f build
git commit -m "Add build folder for PR ${PR_NUMBER}"
git push -u origin pr-releases/pr-${PR_NUMBER} --force
echo "BRANCH_NAME=pr-releases/pr-${PR_NUMBER}" >> $GITHUB_ENV
echo "COMMIT_HASH=$(git rev-parse HEAD)" >> $GITHUB_ENV
- name: Find Previous Comment
uses: peter-evans/find-comment@v3
id: find_comment
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: 'Temporary Branch Update'
direction: last

- name: Create Comment Body
uses: actions/github-script@v7
id: create_body
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const branchName = process.env.BRANCH_NAME;
const commitHash = process.env.COMMIT_HASH;
const prNumber = context.issue.number;
const repoUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}`;
const branchUrl = `${repoUrl}/tree/${branchName}`;
const commitUrl = `${repoUrl}/commit/${commitHash}`;
const commentBody = `
### Temporary Branch Update
The temporary branch has been updated with the latest changes. Below are the details:
- **Branch Name**: [${branchName}](${branchUrl})
- **Commit Hash**: [${commitHash}](${commitUrl})
**NPM**
\`\`\`bash
npm i github:duckduckgo/privacy-dashboard#${commitHash}
\`\`\`
**Git submodule:**
\`\`\`bash
git submodule update --remote --init submodules/privacy-dashboard
cd submodules/privacy-dashboard
git fetch origin
git checkout pr-releases/pr-227
git reset --hard origin/pr-releases/pr-227
\`\`\`
**Swift**

\`\`\`swift
.package(url: "https://github.com/duckduckgo/privacy-dashboard", revision: "${commitHash}"),
\`\`\`
`;
core.setOutput('comment_body', commentBody);
core.setOutput('pr_number', prNumber);
- name: Create, or Update the Comment
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.pull_request.number }}
comment-id: ${{ steps.find_comment.outputs.comment-id }}
body: ${{ steps.create_body.outputs.comment_body }}
edit-mode: replace
clean_up:
if: github.event.action == 'closed'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Delete release branch
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git push origin --delete pr-releases/pr-${PR_NUMBER}
95 changes: 95 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
name: Release

on:
workflow_dispatch:
inputs:
version:
required: true
description: 'Release version'

jobs:
release_pr:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Fetch files and ensure branches exist
run: |
git fetch origin
if [ -f .git/shallow ]; then
echo "Shallow repo clone, unshallowing"
git fetch --unshallow
fi
git fetch --tags
# Check if the 'main' branch exists, if not, create it
if git rev-parse --verify main >/dev/null 2>&1; then
git checkout main
else
git checkout -b main origin/main
fi
# Check if the 'releases' branch exists, if not, create it
if git rev-parse --verify releases >/dev/null 2>&1; then
git checkout releases
else
git checkout -b releases origin/releases
fi
- name: Collect commit ranges
run: |
bash ./scripts/changelog.sh > ${{ github.workspace }}/CHANGELOG.txt
- name: Debug changelog file
run: |
ls -la ${{ github.workspace }}/CHANGELOG.txt
cat ${{ github.workspace }}/CHANGELOG.txt
echo "Current tag is: $(git rev-list --tags --max-count=1)"
- name: Checkout code from main into release branch
run: |
# Checkout the code of main onto releases
git checkout main -- .
- name: Build release
run: |
npm ci
npm run build
- name: Check in files
run: |
git add -f build/
- name: Commit build files
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: 'Release build ${{ github.event.inputs.version }} [ci release]'
commit_options: '--allow-empty'
skip_checkout: true
branch: 'releases'

- name: Debug changelog file
run: |
ls -la ${{ github.workspace }}/CHANGELOG.txt
cat ${{ github.workspace }}/CHANGELOG.txt
- name: Create Release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
body_path: ${{ github.workspace }}/CHANGELOG.txt
draft: false
prerelease: false
tag_name: ${{ github.event.inputs.version }}
target_commitish: 'releases'
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Test & Deploy Docs
on:
pull_request:
# pull_request:
push:
branches:
- main
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ public/js/*.*
public/css/*.*
*.swp
*.swo
build/docs/
__diff_output__
/test-results/
/playwright-report/
Expand All @@ -18,6 +17,7 @@ build/app/html/iframe.html
build/app/html/states.json
build/app/public/font
build/app-debug
build/docs/
.swiftpm/xcode/xcuserdata
build/app_backup
bslive.yml
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18
22
1 change: 1 addition & 0 deletions build/app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*
1 change: 1 addition & 0 deletions build/app/font/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*
1 change: 1 addition & 0 deletions build/app/html/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*
32 changes: 0 additions & 32 deletions build/app/html/android.html

This file was deleted.

32 changes: 0 additions & 32 deletions build/app/html/browser.html

This file was deleted.

32 changes: 0 additions & 32 deletions build/app/html/ios.html

This file was deleted.

32 changes: 0 additions & 32 deletions build/app/html/macos.html

This file was deleted.

Loading

0 comments on commit 47bc86a

Please sign in to comment.