Skip to content

Commit

Permalink
ci(release): private rc releases
Browse files Browse the repository at this point in the history
  • Loading branch information
privatenumber committed May 3, 2024
1 parent 9cba274 commit 669c26e
Showing 1 changed file with 30 additions and 8 deletions.
38 changes: 30 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,27 @@ name: Release

on:
push:
branches: master
branches: [master, develop]

permissions:
contents: write

jobs:
release:
name: Release
if: (
github.repository_owner == 'pvtnbr' && github.ref_name =='develop'
) || (
github.repository_owner == 'privatenumber' && github.ref_name =='master'
)
runs-on: ubuntu-latest
timeout-minutes: 5
timeout-minutes: 10

steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}

- name: Use Node.js
uses: actions/setup-node@v4
Expand All @@ -25,15 +35,27 @@ jobs:
version: 9
run_install: true

- name: Build
run: pnpm build

- name: Test
run: pnpm test

- name: Lint
run: pnpm lint

- name: Prerelease to GitHub
if: github.repository_owner == 'pvtnbr'
run: |
git remote add public https://github.com/$(echo $GITHUB_REPOSITORY | sed "s/^pvtnbr/privatenumber/")
git fetch public master 'refs/tags/*:refs/tags/*'
git push --force --tags origin refs/remotes/public/master:refs/heads/master
jq '
.publishConfig.registry = "https://npm.pkg.github.com"
| .name = ("@" + env.GITHUB_REPOSITORY_OWNER + "/" + .name)
| .repository = env.GITHUB_REPOSITORY
| .release.branches = [
"master",
{ name: "develop", prerelease: "rc", channel: "latest" }
]
' package.json > _package.json
mv _package.json package.json
- name: Release
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
Expand Down

0 comments on commit 669c26e

Please sign in to comment.