Skip to content

Commit

Permalink
meta: fork branch in preparation for LTS
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed Aug 4, 2022
1 parent 28f56e1 commit 5f761ca
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
13 changes: 5 additions & 8 deletions .github/workflows/release-candidate.yml
Expand Up @@ -12,12 +12,7 @@ jobs:
uses: actions/checkout@v3
with:
branch: release
- name: Rebase
run: |
git fetch origin HEAD --depth=1
git config --global user.email "actions@github.com"
git config --global user.name "GitHub Actions"
git rebase FETCH_HEAD
fetch-depth: 2
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(corepack yarn config get cacheFolder)"
Expand Down Expand Up @@ -50,18 +45,20 @@ jobs:
jq -r 'map(.cwd) | join("\n")' < releases.json | awk '{ print "git add " $0 "/package.json" }' | sh
- name: Commit
run: |
echo "Release: uppy@$(jq -r 'map(select(.ident == "uppy"))[0].newVersion' < releases.json)" > commitMessage
echo "Release: uppy@$(jq -r 'map(select(.ident == "uppy"))[0].newVersion' < releases.json) (Maintenance)" > commitMessage
echo >> commitMessage
echo "This is a release candidate for the following packages:" >> commitMessage
echo >> commitMessage
jq -r 'map("- `"+.ident+"`: "+.oldVersion+" -> "+.newVersion) | join("\n") ' < releases.json >> commitMessage
git config --global user.email "actions@github.com"
git config --global user.name "GitHub Actions"
git commit -n --amend --file commitMessage
- name: Open Pull Request
id: pr_opening
run: |
git push origin HEAD:release-candidate
gh api repos/${{ github.repository }}/pulls \
-F base="$(gh api /repos/${{ github.repository }} | jq -r .default_branch)" \
-F base="2.x" \
-F head="release-candidate" \
-F title="$(head -1 commitMessage)" \
-F body="$(git --no-pager diff HEAD^ -- CHANGELOG.md | awk '{ if( substr($0,0,1) == "+" && $1 != "+##" && $1 != "+Released:" && $1 != "+++" ) { print substr($0,2) } }')" \
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Expand Up @@ -62,7 +62,7 @@ jobs:
id: uppyVersion
run: jq -r '"##[set-output name=version;]"+.version' < packages/uppy/package.json
- name: Create GitHub release
run: gh release create uppy@${{ steps.uppyVersion.outputs.version }} -t "Uppy ${{ steps.uppyVersion.outputs.version }}" -F CHANGELOG.diff.md
run: gh release create uppy@${{ steps.uppyVersion.outputs.version }} -t "Uppy ${{ steps.uppyVersion.outputs.version }} (Maintenance)" -F CHANGELOG.diff.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload `uppy` to CDN
Expand Down
2 changes: 1 addition & 1 deletion private/release/config.js
@@ -1,3 +1,3 @@
export const REPO_OWNER = 'transloadit'
export const REPO_NAME = 'uppy'
export const TARGET_BRANCH = 'main'
export const TARGET_BRANCH = '2.x'
8 changes: 4 additions & 4 deletions private/release/getUpToDateRefsFromGitHub.js
Expand Up @@ -25,10 +25,10 @@ export async function getRemoteHEAD () {
}

async function getLatestReleaseSHA () {
const { tag_name } = await apiCall(
`/releases/latest`,
'Cannot get latest release from GitHub, check your internet connection.',
)
const response = await fetch(`https://raw.githubusercontent.com/${REPO_OWNER}/${REPO_NAME}/${TARGET_BRANCH}/packages/uppy/package.json`)
if (!response.ok) throw new Error(`Network call failed: ${response.status} ${response.statusText}`)
const { version } = await response.json()
const tag_name = `uppy@${version}`
console.log(`Last release was ${tag_name}.`)
return (
await apiCall(
Expand Down

0 comments on commit 5f761ca

Please sign in to comment.