Skip to content

Commit 295fc92

Browse files
committed
Workflow for release
1 parent 76f6932 commit 295fc92

File tree

4 files changed

+136
-9
lines changed

4 files changed

+136
-9
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,8 @@ jobs:
1717
uses: actions/checkout@v4
1818
- name: Build
1919
uses: 4d/build4d-action@main
20+
with:
21+
product-line: vcs
22+
version: vcs
23+
build: official
24+
token: ${{ secrets.DLTK }}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Create Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
tag_prefix:
7+
description: 'Tag prefix to use instead of branch'
8+
required: false
9+
default: ''
10+
type: string
11+
tag_suffix:
12+
description: 'Tag suffix'
13+
required: false
14+
default: ''
15+
type: string
16+
17+
jobs:
18+
create-tag-and-release:
19+
runs-on: ubuntu-latest
20+
permissions:
21+
contents: write # for tag and release creation
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0 # Fetch all history and tags
27+
ref: ${{ github.ref }}
28+
token: ${{ secrets.GITHUB_TOKEN }}
29+
30+
- name: Create Release Tag
31+
id: create_tag
32+
uses: e-marchand/auto-increment-tag-action@v2
33+
with:
34+
tag_prefix: "${{ inputs.tag_prefix }}"
35+
tag_suffix: "${{ inputs.tag_suffix }}"
36+
generate_commit_links: 'true'
37+
github_token: ${{ secrets.GITHUB_TOKEN }}
38+
39+
- name: Create GitHub Release
40+
if: steps.create_tag.outputs.tag_created == 'true'
41+
id: create_release
42+
uses: e-marchand/action-gh-release@v2.3.2
43+
with:
44+
tag_name: ${{ steps.create_tag.outputs.tag }}
45+
name: ${{ steps.create_tag.outputs.tag }}
46+
body: ${{ steps.create_tag.outputs.commit_links }}
47+
draft: false
48+
prerelease: ${{ contains(steps.create_tag.outputs.tag, 'main.') || contains(inputs.tag_suffix, '-') }}
49+
token: ${{ secrets.PAT_TOKEN }}

.github/workflows/release.yml

Lines changed: 74 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,85 @@ on:
33
release:
44
types: [published]
55
jobs:
6-
publish:
7-
name: Publish
8-
runs-on: macos-latest
6+
create:
7+
name: "Create"
8+
runs-on: macOS
99
env:
1010
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
11-
permissions:
12-
contents: write # for asset upload
1311
steps:
1412
- name: ⬇️ Checkout
15-
uses: actions/checkout@v4
13+
uses: actions/checkout@v5
14+
15+
- name: ⬇️ Checkout postBuild
16+
uses: actions/checkout@v5
17+
with:
18+
repository: 4d/${{secrets.POST_BUILD_REPO}}
19+
token: ${{secrets.PAT_TOKEN}}
20+
sparse-checkout: |
21+
${{ secrets.POST_BUILD_PATH }}
22+
path: Components/${{ secrets.POST_BUILD_REPO }}
23+
1624
- name: BuildAndPackage
25+
id: build-package
1726
uses: 4d/build4d-action@main
1827
with:
19-
actions: "build,pack,archive"
20-
- name: Upload
28+
actions: "release"
29+
product-line: vcs
30+
version: vcs
31+
build: official
32+
token: ${{ secrets.DLTK }}
33+
after-build: "./Components/${{ secrets.POST_BUILD_REPO }}/${{ secrets.POST_BUILD_SCRIPT }}"
34+
sign-certificate: "${{ secrets.SIGN_CERTIFICATE }}"
35+
env:
36+
LOGIN_KEYCHAIN_PASSWORD: "${{ secrets.KEYCHAIN }}"
37+
38+
- name: Upload Artifact
39+
uses: actions/upload-artifact@v4
40+
with:
41+
name: "${{ github.event.repository.name }}.zip"
42+
path: "build/${{ github.event.repository.name }}.zip"
43+
retention-days: 1
44+
if-no-files-found: error
45+
46+
clear:
47+
needs: create
48+
if: failure()
49+
name: "Clear on failure"
50+
runs-on: ubuntu-latest
51+
permissions:
52+
contents: write # for release deletion
53+
steps:
54+
- name: 📄 Checkout repository
55+
uses: "actions/checkout@v5"
56+
with:
57+
fetch-depth: 0
58+
- name: Remove release
59+
run: |
60+
echo "Build and package step failed. Checking for errors..."
61+
echo "Removing release"
62+
gh release delete ${{github.event.release.tag_name}} || echo "Release deletion failed"
63+
env:
64+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65+
66+
publish:
67+
needs: create
68+
name: "Publish package"
69+
runs-on: ubuntu-latest
70+
71+
permissions:
72+
contents: write # for asset upload
73+
steps:
74+
- name: 📄 Checkout repository
75+
uses: "actions/checkout@v5"
76+
with:
77+
fetch-depth: 0
78+
- name: Download packages
79+
uses: actions/download-artifact@v4
80+
with:
81+
name: "${{ github.event.repository.name }}.zip"
82+
path: artifact
83+
- name: 📦 release package
2184
run: |
22-
gh release upload ${{github.event.release.tag_name}} "build/4D-Mobile-App-Server.zip"
85+
gh release upload ${{github.event.release.tag_name}} "${{github.workspace}}/artifact/${{ github.event.repository.name }}.zip"
86+
env:
87+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Project/Sources/folders.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
},
4444
"devTool": {
4545
"methods": [
46+
"checkGitBranch",
4647
"COMPILER_dev",
4748
"dev IndexName",
4849
"dev UpdateStructure"
@@ -79,8 +80,11 @@
7980
},
8081
"push": {
8182
"methods": [
83+
"android_sendNotification",
8284
"apple_sendNotification",
8385
"authJWT",
86+
"buildAndroidNotification",
87+
"buildAppleNotification",
8488
"buildRecipients",
8589
"checkCurlWindow",
8690
"checkXCodeVersionForPushNotif",
@@ -120,12 +124,16 @@
120124
],
121125
"methods": [
122126
"Compiler_test",
127+
"createTestSession",
128+
"deleteTestSession",
123129
"onMobileAppActionTest",
124130
"test_action",
125131
"test_actionParsing",
132+
"test_android_pushnotification",
126133
"test_app",
127134
"test_authentication",
128135
"test_dev",
136+
"test_ios_pushnotification",
129137
"test_isEmail",
130138
"test_manageEntryRecipient",
131139
"test_session",

0 commit comments

Comments
 (0)