Skip to content

Commit

Permalink
fix: add correct publish tag for backports
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys committed Jul 10, 2023
1 parent 3aa4591 commit ba07c1a
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ jobs:
RELEASE_COMMENT_ID: ${{ needs.release.outputs.comment-id }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm exec --offline -- template-oss-release-manager --lockfile=false --publish=true
npm exec --offline -- template-oss-release-manager --lockfile=false --publish=true --tag=latest
npm run rp-pull-request --ignore-scripts -ws -iwr --if-present
- name: Commit
id: commit
Expand Down Expand Up @@ -337,7 +337,7 @@ jobs:
- name: Publish
env:
PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
run: npm publish --provenance
run: npm publish --provenance --tag=latest

post-release-integration:
needs: [ release, release-integration ]
Expand Down
12 changes: 9 additions & 3 deletions bin/release-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,14 @@ const ROOT = process.cwd()
const pkg = require(join(ROOT, 'package.json'))

const args = process.argv.slice(2).reduce((acc, a) => {
const [k, v] = a.replace(/^--/g, '').split('=')
acc[k] = v === 'true'
const [k, v] = a.replace(/^--/, '').split('=')
if (v === 'true') {
acc[k] = true
} else if (v === 'false') {
acc[k] = false
} else if (v && typeof v === 'string') {
acc[k] = v.trim()
}
return acc
}, {})

Expand Down Expand Up @@ -135,7 +141,7 @@ const getPrReleases = async (pr) => {
version: rawVersion,
major: version.major,
url: `https://github.com/${pr.base.repo.full_name}/releases/tag/${tag}`,
flags: `${name ? `-w ${workspace}` : ''} ${prerelease ? `--tag prerelease` : ''}`.trim(),
flags: `${name ? `-w ${workspace}` : ''} --tag ${args.tag}`.trim(),
}
}

Expand Down
4 changes: 0 additions & 4 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,7 @@ const getFullConfig = async ({
const gitBranches = await git.getBranches(rootPkg.path, branches)
const currentBranch = await git.currentBranch(rootPkg.path)
const isReleaseBranch = currentBranch ? minimatch(currentBranch, pkgConfig.releaseBranch) : false
<<<<<<< HEAD
const defaultBranch = await git.defaultBranch(rootPkg.path) ?? 'main'
=======
const defaultBranch = await git.defaultBranch(rootPkg.path) ?? pkgConfig.defaultBranch ?? 'main'
>>>>>>> d50eee3 (feat: use git remote for branch related config)

// all derived keys
const derived = {
Expand Down
2 changes: 1 addition & 1 deletion lib/content/_job-release-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ steps:
- name: Publish
env:
PUBLISH_TOKEN: $\{{ secrets.PUBLISH_TOKEN }}
run: npm publish --provenance
run: npm publish --provenance --tag={{ publishTag }}
{{else}}
runs-on: ubuntu-latest
defaults:
Expand Down
2 changes: 1 addition & 1 deletion lib/content/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
RELEASE_COMMENT_ID: $\{{ needs.release.outputs.comment-id }}
GITHUB_TOKEN: $\{{ secrets.GITHUB_TOKEN }}
run: |
{{ rootNpmPath }} exec --offline -- template-oss-release-manager --lockfile={{ lockfile }} --publish={{ publish }}
{{ rootNpmPath }} exec --offline -- template-oss-release-manager --lockfile={{ lockfile }} --publish={{ publish }} --tag={{ publishTag }}
{{ rootNpmPath }} run rp-pull-request --ignore-scripts {{~#if allFlags}} {{ allFlags }}{{else}} --if-present{{/if}}
- name: Commit
id: commit
Expand Down
6 changes: 3 additions & 3 deletions tap-snapshots/test/apply/source-snapshots.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -988,7 +988,7 @@ jobs:
RELEASE_COMMENT_ID: \${{ needs.release.outputs.comment-id }}
GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
run: |
npm exec --offline -- template-oss-release-manager --lockfile=false --publish=false
npm exec --offline -- template-oss-release-manager --lockfile=false --publish=false --tag=latest
npm run rp-pull-request --ignore-scripts --if-present
- name: Commit
id: commit
Expand Down Expand Up @@ -2668,7 +2668,7 @@ jobs:
RELEASE_COMMENT_ID: \${{ needs.release.outputs.comment-id }}
GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
run: |
npm exec --offline -- template-oss-release-manager --lockfile=false --publish=false
npm exec --offline -- template-oss-release-manager --lockfile=false --publish=false --tag=latest
npm run rp-pull-request --ignore-scripts -ws -iwr --if-present
- name: Commit
id: commit
Expand Down Expand Up @@ -4200,7 +4200,7 @@ jobs:
RELEASE_COMMENT_ID: \${{ needs.release.outputs.comment-id }}
GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
run: |
npm exec --offline -- template-oss-release-manager --lockfile=false --publish=false
npm exec --offline -- template-oss-release-manager --lockfile=false --publish=false --tag=latest
npm run rp-pull-request --ignore-scripts -ws -iwr --if-present
- name: Commit
id: commit
Expand Down

0 comments on commit ba07c1a

Please sign in to comment.