Skip to content

Commit

Permalink
Auto release (#268)
Browse files Browse the repository at this point in the history
* Create auto release process
* Move to auto for tagging
* Remove build files
* Add building to ci
* Allow empty commits into release
  • Loading branch information
jonathanKingston authored Feb 22, 2023
1 parent 4066c3b commit 769e025
Show file tree
Hide file tree
Showing 16 changed files with 3,549 additions and 43,491 deletions.
9 changes: 9 additions & 0 deletions .autorc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"plugins": [
"git-tag"
],
"baseBranch": "releases",
"owner": "duckduckgo",
"repo": "content-scope-scripts",
"onlyPublishWithReleaseLabel": true
}
2 changes: 0 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
Sources/ContentScopeScripts/dist/** binary linguist-generated
build/** binary linguist-generated
src/locales/** linguist-generated
34 changes: 12 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
name: Release

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

jobs:
release_pr:
runs-on: ubuntu-latest
Expand All @@ -19,25 +12,22 @@ jobs:
node-version: 18
cache: 'npm'

- name: Bump version and config
- name: Build release
run: |
npm run install
npm install
npm run build
git add -f build
- name: Check in files
run: |
git add -f build/ Sources/
- name: Commit build files
uses: stefanzweifel/git-auto-commit-action@3ea6ae190baf489ba007f7c92608f33ce20ef04a
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "Release ${{ github.event.inputs.version }} [ci release]"
commit_message: "Release build [ci release]"
commit_options: '--allow-empty'
branch: "releases"

# - name: Create Release
# uses: softprops/action-gh-release@d4e8205d7e959a9107da6396278b2f1f07af0f9b
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# draft: false
# prerelease: false
# body: "${{ steps.changelog.outputs.changelog }}\n\n${{ env.BUILT_WITH }}"
# tag_name: ${{ env.VERSION }}
# target_commitish: ${{ github.ref }}
- name: Ship
run: |
npx auto shipit
35 changes: 35 additions & 0 deletions .github/workflows/pr-flow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Release

#... on push after PR

jobs:
release_pr:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'

- name: Build release
run: |
npm install
npm run build
- name: Check in files
run: |
git add -f build/ Sources/
- name: Commit build files
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "Release staging build [ci release]"
--create-branch
branch: "releases-${....}" # numbered by PR number

## add comment to PR about link?

## separate workflow on pr merge delete release branch?
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
restore-keys: |
${{ runner.os }}-node-
- run: npm install
- run: npm run build
- run: npm run lint
- run: npm run test-unit
- name: "Clean tree"
Expand All @@ -41,4 +42,5 @@ jobs:
run: |
sudo apt-get install xvfb
npm install
npm run build
- run: npm run test-int-x
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.DS_Store
node_modules/
.swiftpm
.env
Loading

0 comments on commit 769e025

Please sign in to comment.