Skip to content

Commit

Permalink
chore: update release process (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
nowyDEV authored Dec 18, 2023
1 parent ff4b65b commit 9c00e06
Showing 1 changed file with 3 additions and 60 deletions.
63 changes: 3 additions & 60 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,65 +24,8 @@ jobs:
node-version-file: package.json
- name: Install dependencies
run: npm ci
- name: Initialize Git user
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: Set NPM config
run: npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
- name: Release
env:
NPM_TOKEN: ${{ secrets.NPM_KEY }}
- name: Delete branch protection on master
uses: actions/[email protected]
with:
github-token: ${{ secrets.GH_TOKEN }}
script: |
try {
await github.request(
`DELETE /repos/nordcloud/eslint-config-pat/branches/master/protection`,
);
} catch (error) {
if (!error.message?.includes?.("Branch not protected")) {
throw error;
}
}
- env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
if npm run should-semantic-release ; then
npx release-it --verbose
fi
- if: always()
name: Recreate branch protection on master
uses: actions/[email protected]
with:
github-token: ${{ secrets.GH_TOKEN }}
script: |
github.request(
`PUT /repos/nordcloud/eslint-config-pat/branches/master/protection`,
{
allow_deletions: false,
allow_force_pushes: true,
allow_fork_pushes: false,
allow_fork_syncing: true,
block_creations: false,
branch: "master",
enforce_admins: false,
owner: "nordcloud",
repo: "eslint-config-pat",
required_conversation_resolution: true,
required_linear_history: true,
required_pull_request_reviews: {
require_code_owner_reviews: true,
required_approving_review_count: 1,
dismiss_stale_reviews: true
},
required_status_checks: {
checks: [
{ context: "compliance" },
],
strict: false,
},
restrictions: null,
}
);
NPM_TOKEN: ${{ secrets.NPM_KEY }}
uses: JoshuaKGoldberg/[email protected]

0 comments on commit 9c00e06

Please sign in to comment.