Skip to content

Commit 4577007

Browse files
committed
docs: test new version splitting logic
1 parent 013eb02 commit 4577007

1 file changed

Lines changed: 160 additions & 155 deletions

File tree

.github/workflows/release.yml

Lines changed: 160 additions & 155 deletions
Original file line numberDiff line numberDiff line change
@@ -22,156 +22,159 @@ on:
2222
required: false
2323
type: string
2424
default: ''
25+
push:
26+
branches:
27+
- docs/fix-auto-versions
2528

2629
jobs:
2730
# Test before releasing to ensure we don't release a broken version
28-
build_and_test:
29-
name: Build & Test
30-
if: (!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, 'docs:'))
31-
strategy:
32-
fail-fast: true
33-
matrix:
34-
# We don't test on Windows as the tests are flaky
35-
os: [ ubuntu-22.04 ]
36-
node-version: [ 16, 18, 20, 22, 24 ]
37-
38-
runs-on: ${{ matrix.os }}
39-
40-
steps:
41-
- name: Cancel Workflow Action
42-
uses: styfle/cancel-workflow-action@0.12.1
43-
with:
44-
access_token: ${{ github.token }}
45-
46-
- name: Checkout repository
47-
uses: actions/checkout@v4
48-
49-
- name: Use Node.js ${{ matrix.node-version }}
50-
uses: actions/setup-node@v4
51-
with:
52-
node-version: ${{ matrix.node-version }}
53-
54-
- name: Enable corepack
55-
run: |
56-
corepack enable
57-
corepack prepare yarn@stable --activate
58-
59-
- name: Activate cache for Node.js ${{ matrix.node-version }}
60-
uses: actions/setup-node@v4
61-
with:
62-
cache: 'yarn'
63-
64-
- name: Turbo cache
65-
id: turbo-cache
66-
uses: actions/cache@v4
67-
with:
68-
path: .turbo
69-
key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ github.sha }}
70-
restore-keys: |
71-
turbo-${{ github.job }}-${{ github.ref_name }}-
72-
73-
- name: Install Dependencies
74-
run: |
75-
yarn
76-
yarn playwright install --with-deps
77-
78-
- name: Build
79-
run: yarn ci:build
80-
81-
- name: Tests
82-
run: yarn test
83-
84-
release:
85-
name: "Bump Crawlee: ${{ inputs.version }} version (${{ inputs.custom_version || 'n/a' }} custom version)"
86-
if: (!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, 'docs:'))
87-
needs: build_and_test
88-
runs-on: ubuntu-22.04
89-
90-
steps:
91-
- name: Checkout repository
92-
uses: actions/checkout@v4
93-
with:
94-
token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
95-
fetch-depth: 0
96-
97-
- name: Use Node.js 20
98-
uses: actions/setup-node@v4
99-
with:
100-
node-version: 20
101-
102-
- name: Enable corepack
103-
run: |
104-
corepack enable
105-
corepack prepare yarn@stable --activate
106-
107-
- name: Activate cache for Node.js 20
108-
uses: actions/setup-node@v4
109-
with:
110-
cache: 'yarn'
111-
112-
- name: Turbo cache
113-
id: turbo-cache
114-
uses: actions/cache@v4
115-
with:
116-
path: .turbo
117-
key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ github.sha }}
118-
restore-keys: |
119-
turbo-${{ github.job }}-${{ github.ref_name }}-
120-
121-
- name: Install Dependencies
122-
run: yarn
123-
124-
- name: Build
125-
run: yarn ci:build
126-
127-
- name: Setup git user and npm
128-
run: |
129-
git config --global user.name "Apify Release Bot"
130-
git config --global user.email "noreply@apify.com"
131-
132-
echo "access=public" > .npmrc
133-
echo "//registry.npmjs.org/:_authToken=${{ secrets.APIFY_SERVICE_ACCOUNT_NPM_TOKEN }}" >> .npmrc
134-
135-
- name: Bump version to custom version
136-
if: ${{ github.event.inputs.version == 'custom' && github.event.inputs.custom_version != '' }}
137-
run: yarn lerna version ${{ github.event.inputs.custom_version }} --force-publish --yes
138-
env:
139-
NPM_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_NPM_TOKEN }}
140-
GIT_USER: 'noreply@apify.com:${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}'
141-
GH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
142-
143-
- name: Bump version to ${{ github.event.inputs.version }} version
144-
if: ${{ github.event.inputs.version != 'custom' }}
145-
run: yarn lerna version ${{ github.event.inputs.version }} --force-publish --yes
146-
env:
147-
NPM_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_NPM_TOKEN }}
148-
GIT_USER: 'noreply@apify.com:${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}'
149-
GH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
150-
151-
- name: Pin versions in internal dependencies and update lockfile
152-
run: |
153-
yarn release:pin-versions
154-
yarn install --no-immutable
155-
git add .
156-
git diff-index --quiet HEAD || git commit -m 'chore(release): update internal dependencies [skip ci]'
157-
git push
158-
159-
- name: Publish packages
160-
run: yarn publish:prod --yes --no-verify-access
161-
env:
162-
NPM_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_NPM_TOKEN }}
163-
GIT_USER: 'noreply@apify.com:${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}'
164-
GH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
165-
166-
- name: Trigger Docker image builds
167-
uses: peter-evans/repository-dispatch@v3
168-
with:
169-
token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
170-
repository: apify/apify-actor-docker
171-
event-type: build-node-images
31+
# build_and_test:
32+
# name: Build & Test
33+
# if: (!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, 'docs:'))
34+
# strategy:
35+
# fail-fast: true
36+
# matrix:
37+
# # We don't test on Windows as the tests are flaky
38+
# os: [ ubuntu-22.04 ]
39+
# node-version: [ 16, 18, 20, 22, 24 ]
40+
41+
# runs-on: ${{ matrix.os }}
42+
43+
# steps:
44+
# - name: Cancel Workflow Action
45+
# uses: styfle/cancel-workflow-action@0.12.1
46+
# with:
47+
# access_token: ${{ github.token }}
48+
49+
# - name: Checkout repository
50+
# uses: actions/checkout@v4
51+
52+
# - name: Use Node.js ${{ matrix.node-version }}
53+
# uses: actions/setup-node@v4
54+
# with:
55+
# node-version: ${{ matrix.node-version }}
56+
57+
# - name: Enable corepack
58+
# run: |
59+
# corepack enable
60+
# corepack prepare yarn@stable --activate
61+
62+
# - name: Activate cache for Node.js ${{ matrix.node-version }}
63+
# uses: actions/setup-node@v4
64+
# with:
65+
# cache: 'yarn'
66+
67+
# - name: Turbo cache
68+
# id: turbo-cache
69+
# uses: actions/cache@v4
70+
# with:
71+
# path: .turbo
72+
# key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ github.sha }}
73+
# restore-keys: |
74+
# turbo-${{ github.job }}-${{ github.ref_name }}-
75+
76+
# - name: Install Dependencies
77+
# run: |
78+
# yarn
79+
# yarn playwright install --with-deps
80+
81+
# - name: Build
82+
# run: yarn ci:build
83+
84+
# - name: Tests
85+
# run: yarn test
86+
87+
# release:
88+
# name: "Bump Crawlee: ${{ inputs.version }} version (${{ inputs.custom_version || 'n/a' }} custom version)"
89+
# if: (!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, 'docs:'))
90+
# needs: build_and_test
91+
# runs-on: ubuntu-22.04
92+
93+
# steps:
94+
# - name: Checkout repository
95+
# uses: actions/checkout@v4
96+
# with:
97+
# token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
98+
# fetch-depth: 0
99+
100+
# - name: Use Node.js 20
101+
# uses: actions/setup-node@v4
102+
# with:
103+
# node-version: 20
104+
105+
# - name: Enable corepack
106+
# run: |
107+
# corepack enable
108+
# corepack prepare yarn@stable --activate
109+
110+
# - name: Activate cache for Node.js 20
111+
# uses: actions/setup-node@v4
112+
# with:
113+
# cache: 'yarn'
114+
115+
# - name: Turbo cache
116+
# id: turbo-cache
117+
# uses: actions/cache@v4
118+
# with:
119+
# path: .turbo
120+
# key: turbo-${{ github.job }}-${{ github.ref_name }}-${{ github.sha }}
121+
# restore-keys: |
122+
# turbo-${{ github.job }}-${{ github.ref_name }}-
123+
124+
# - name: Install Dependencies
125+
# run: yarn
126+
127+
# - name: Build
128+
# run: yarn ci:build
129+
130+
# - name: Setup git user and npm
131+
# run: |
132+
# git config --global user.name "Apify Release Bot"
133+
# git config --global user.email "noreply@apify.com"
134+
135+
# echo "access=public" > .npmrc
136+
# echo "//registry.npmjs.org/:_authToken=${{ secrets.APIFY_SERVICE_ACCOUNT_NPM_TOKEN }}" >> .npmrc
137+
138+
# - name: Bump version to custom version
139+
# if: ${{ github.event.inputs.version == 'custom' && github.event.inputs.custom_version != '' }}
140+
# run: yarn lerna version ${{ github.event.inputs.custom_version }} --force-publish --yes
141+
# env:
142+
# NPM_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_NPM_TOKEN }}
143+
# GIT_USER: 'noreply@apify.com:${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}'
144+
# GH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
145+
146+
# - name: Bump version to ${{ github.event.inputs.version }} version
147+
# if: ${{ github.event.inputs.version != 'custom' }}
148+
# run: yarn lerna version ${{ github.event.inputs.version }} --force-publish --yes
149+
# env:
150+
# NPM_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_NPM_TOKEN }}
151+
# GIT_USER: 'noreply@apify.com:${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}'
152+
# GH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
153+
154+
# - name: Pin versions in internal dependencies and update lockfile
155+
# run: |
156+
# yarn release:pin-versions
157+
# yarn install --no-immutable
158+
# git add .
159+
# git diff-index --quiet HEAD || git commit -m 'chore(release): update internal dependencies [skip ci]'
160+
# git push
161+
162+
# - name: Publish packages
163+
# run: yarn publish:prod --yes --no-verify-access
164+
# env:
165+
# NPM_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_NPM_TOKEN }}
166+
# GIT_USER: 'noreply@apify.com:${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}'
167+
# GH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
168+
169+
# - name: Trigger Docker image builds
170+
# uses: peter-evans/repository-dispatch@v3
171+
# with:
172+
# token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
173+
# repository: apify/apify-actor-docker
174+
# event-type: build-node-images
172175

173176
version-docs:
174-
needs: release
177+
# needs: release
175178
runs-on: ubuntu-22.04
176179
if: (github.event.inputs.version == 'minor' || github.event.inputs.version == 'major')
177180

@@ -212,13 +215,15 @@ jobs:
212215
- name: Snapshot the current version
213216
run: |
214217
cd website
215-
yarn docusaurus docs:version $(jq .version ../lerna.json | sed s/\"//g | head -c 3)
216-
yarn docusaurus api:version $(jq .version ../lerna.json | sed s/\"//g | head -c 3)
217-
218-
- name: Commit and push the version snapshot
219-
run: |
220-
git config --global user.name "Apify Release Bot"
221-
git config --global user.email "noreply@apify.com"
222-
git add .
223-
git diff-index --quiet HEAD || git commit -m 'chore(release): update docs for ${{ inputs.version }} version [skip ci]'
224-
git push
218+
VERSION=3.14.2 ## Replace with the actual version to snapshot
219+
MAJOR_MINOR=$(echo $VERSION | cut -d. -f1,2)
220+
yarn docusaurus docs:version $MAJOR_MINOR
221+
yarn docusaurus api:version $MAJOR_MINOR
222+
223+
# - name: Commit and push the version snapshot
224+
# run: |
225+
# git config --global user.name "Apify Release Bot"
226+
# git config --global user.email "noreply@apify.com"
227+
# git add .
228+
# git diff-index --quiet HEAD || git commit -m 'chore(release): update docs for ${{ inputs.version }} version [skip ci]'
229+
# git push

0 commit comments

Comments
 (0)