Skip to content

Commit b7b33a7

Browse files
committed
feat: add build channel option and automatic version computation
1 parent f329968 commit b7b33a7

File tree

1 file changed

+53
-9
lines changed

1 file changed

+53
-9
lines changed

.github/workflows/release-generic-actors.yaml

Lines changed: 53 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,22 @@ on:
3333
type: boolean
3434
required: false
3535
default: true
36+
build-channel:
37+
description: Build channel
38+
type: choice
39+
required: true
40+
options:
41+
- stable
42+
- development
43+
- custom
3644
version:
37-
description: Version to build
45+
description: Custom version (only for custom build channel)
3846
type: string
39-
required: true
40-
default: '3.0'
47+
required: false
4148
build-tag:
42-
description: Build tag
49+
description: Custom build tag (only for custom build channel)
4350
type: string
44-
required: true
45-
default: version-3
51+
required: false
4652

4753
jobs:
4854
push-to-apify:
@@ -52,25 +58,63 @@ jobs:
5258
matrix:
5359
settings:
5460
- actor: web-scraper
61+
stable-version: 3.0
62+
stable-build-tag: version-3
63+
development-version: 0.0
64+
development-build-tag: development
5565
should-build: ${{ github.event.inputs.web-scraper }}
5666
- actor: cheerio-scraper
67+
stable-version: 3.0
68+
stable-build-tag: version-3
69+
development-version: 0.0
70+
development-build-tag: development
5771
should-build: ${{ github.event.inputs.cheerio-scraper }}
5872
- actor: playwright-scraper
73+
stable-version: 1.0
74+
stable-build-tag: version-1
75+
development-version: 0.0
76+
development-build-tag: development
5977
should-build: ${{ github.event.inputs.playwright-scraper }}
6078
- actor: puppeteer-scraper
79+
stable-version: 3.0
80+
stable-build-tag: version-3
81+
development-version: 0.0
82+
development-build-tag: development
6183
should-build: ${{ github.event.inputs.puppeteer-scraper }}
6284
- actor: jsdom-scraper
85+
stable-version: 0.1
86+
stable-build-tag: latest
87+
development-version: 0.0
88+
development-build-tag: development
6389
should-build: ${{ github.event.inputs.jsdom-scraper }}
6490
- actor: camoufox-scraper
91+
stable-version: 3.0
92+
stable-build-tag: version-3
93+
development-version: 0.0
94+
development-build-tag: development
6595
should-build: ${{ github.event.inputs.camoufox-scraper }}
6696
steps:
6797
- uses: actions/checkout@v4
6898

99+
- name: Calculate versions and tags
100+
id: calculate-versions
101+
if: matrix.settings.should-build == 'true'
102+
run: |
103+
if [ "${{ github.event.inputs.build-channel }}" == "stable" ]; then
104+
echo "version=${{ matrix.settings.stable-version }}\n" >> $GITHUB_ENV
105+
echo "build-tag=${{ matrix.settings.stable-build-tag }}\n" >> $GITHUB_ENV
106+
elif [ "${{ github.event.inputs.build-channel }}" == "development" ]; then
107+
echo "version=${{ matrix.settings.development-version }}\n" >> $GITHUB_ENV
108+
echo "build-tag=${{ matrix.settings.development-build-tag }}\n" >> $GITHUB_ENV
109+
else
110+
echo "version=${{ github.event.inputs.version }}\n" >> $GITHUB_ENV
111+
echo "build-tag=${{ github.event.inputs.build-tag }}\n" >> $GITHUB_ENV
112+
fi
113+
69114
- name: Build ${{ matrix.settings.actor }}
70115
uses: apify/push-actor-action@master
71-
if: matrix.settings.should-build == 'true'
72116
with:
73117
token: ${{ secrets.APIFY_ACTOR_BUILD_TOKEN }}
74-
build-tag: ${{ github.event.inputs.build-tag }}
75-
version: ${{ github.event.inputs.version }}
118+
build-tag: ${{ steps.calculate-versions.outputs.build-tag }}
119+
version: ${{ steps.calculate-versions.outputs.version }}
76120
working-directory: packages/actor-scraper/${{ matrix.settings.actor }}

0 commit comments

Comments
 (0)