Skip to content

Commit ca259e0

Browse files
authored
Merge pull request #10 from appcircleio/release/0.1.0
Release/0.1.0
2 parents 6ebdaf1 + 876c45e commit ca259e0

11 files changed

Lines changed: 417 additions & 74 deletions

File tree

.githooks/pre-push

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env bash
2+
# shellcheck shell=bash
3+
set -euo pipefail
4+
5+
# Rejects pushing non-standard tags. Release tags must be SemVer with a 'v' prefix:
6+
# vX.Y.Z (production, e.g. v0.5.0)
7+
# vX.Y.Z-<pre> (pre-release, e.g. v0.5.0-beta.1 — normally created by CI)
8+
# Examples REJECTED: X.Y.Z, X.Y, vX.Y, 1.0, v1.
9+
#
10+
# Enable once per clone: git config core.hooksPath .githooks
11+
12+
pattern='^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.]+)?$'
13+
zero='0000000000000000000000000000000000000000'
14+
status=0
15+
16+
while read -r _local_ref _local_sha remote_ref remote_sha; do
17+
case "$remote_ref" in
18+
refs/tags/*)
19+
# Allow tag deletions (remote_sha stays, local sha is zero on delete is the other way;
20+
# we only validate creations/updates).
21+
[ "$remote_sha" = "$zero" ] && continue || true
22+
tag="${remote_ref#refs/tags/}"
23+
if ! printf '%s' "$tag" | grep -qE "$pattern"; then
24+
echo "✖ Refused to push tag '$tag'." >&2
25+
echo " Release tags must be SemVer with a 'v' prefix, e.g. v0.5.0 (or v0.5.0-beta.1)." >&2
26+
echo " Rejected forms: X.Y.Z, X.Y, vX.Y, bare numbers." >&2
27+
status=1
28+
fi
29+
;;
30+
esac
31+
done
32+
33+
exit $status

.github/workflows/release.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Release
2+
on:
3+
push:
4+
branches:
5+
- main
6+
- 'release/**'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- uses: actions/setup-node@v4
20+
with:
21+
node-version: 20
22+
23+
- name: Build bundle (smoke test)
24+
run: |
25+
npm ci
26+
npm run package
27+
28+
- name: Release
29+
env:
30+
GH_TOKEN: ${{ github.token }}
31+
run: |
32+
set -euo pipefail
33+
BRANCH="${GITHUB_REF_NAME}"
34+
git config user.name "github-actions[bot]"
35+
git config user.email "github-actions[bot]@users.noreply.github.com"
36+
37+
# Version source of truth = latest stable tag vX.Y.Z (pushed manually).
38+
# Used for BOTH production and beta — the branch only selects the channel.
39+
STABLE="$(git tag --list 'v*' | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -1)"
40+
if [ -z "$STABLE" ]; then
41+
echo "::error::No stable vX.Y.Z tag found. Push the release tag (e.g. v0.5.0) first."
42+
exit 1
43+
fi
44+
echo "Latest stable tag: $STABLE"
45+
46+
if [ "$BRANCH" = "main" ]; then
47+
if gh release view "$STABLE" >/dev/null 2>&1; then
48+
echo "Release $STABLE already exists — nothing to do."
49+
exit 0
50+
fi
51+
echo "Production release: $STABLE"
52+
gh release create "$STABLE" --title "$STABLE" --generate-notes --latest
53+
MAJOR="${STABLE%%.*}"
54+
git tag -f "$MAJOR" "$STABLE"
55+
git push origin -f "refs/tags/$MAJOR"
56+
echo "Moved major alias $MAJOR -> $STABLE"
57+
elif [[ "$BRANCH" == release/* ]]; then
58+
# Beta of the latest stable tag; auto-increment N from existing beta tags.
59+
LAST="$(git tag --list "${STABLE}-beta.*" | sed -E 's/.*-beta\.([0-9]+)$/\1/' | sort -n | tail -1)"
60+
N=$(( ${LAST:-0} + 1 ))
61+
TAG="${STABLE}-beta.${N}"
62+
echo "Beta release: $TAG (base $STABLE)"
63+
git tag "$TAG"
64+
git push origin "refs/tags/$TAG"
65+
gh release create "$TAG" --title "$TAG" --generate-notes --prerelease
66+
else
67+
echo "Branch '$BRANCH' is not configured for release — skipping."
68+
fi

.github/workflows/test.yml

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
name: CI Pipeline
1+
# name: CI Pipeline
22

3-
on:
4-
push:
5-
branches:
6-
- main
7-
pull_request:
8-
branches:
9-
- main
3+
# on:
4+
# push:
5+
# branches:
6+
# - main
7+
# pull_request:
8+
# branches:
9+
# - main
1010

11-
workflow_dispatch:
11+
# workflow_dispatch:
1212

13-
jobs:
14-
build:
15-
runs-on: ubuntu-latest
13+
# jobs:
14+
# build:
15+
# runs-on: ubuntu-latest
1616

17-
steps:
18-
- name: Checkout code
19-
uses: actions/checkout@v3
17+
# steps:
18+
# - name: Checkout code
19+
# uses: actions/checkout@v3
2020

21-
- name: Set up Node.js
22-
uses: actions/setup-node@v3
23-
with:
24-
node-version: '16'
21+
# - name: Set up Node.js
22+
# uses: actions/setup-node@v3
23+
# with:
24+
# node-version: '16'
2525

26-
- name: Test Local Action
27-
id: test-action
28-
uses: ./
29-
with:
30-
accessToken: ${{ secrets.AC_ACCESS_TOKEN }}
31-
profileID: ${{ secrets.AC_PROFILE_ID }}
32-
appPath: ${{ secrets.APP_PATH }}
33-
message: ${{ secrets.MESSAGE }}
26+
# - name: Test Local Action
27+
# id: test-action
28+
# uses: ./
29+
# with:
30+
# accessToken: ${{ secrets.AC_ACCESS_TOKEN }}
31+
# profileID: ${{ secrets.AC_PROFILE_ID }}
32+
# appPath: ${{ secrets.APP_PATH }}
33+
# message: ${{ secrets.MESSAGE }}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,7 @@ __tests__/runner/*
101101
.idea
102102
.vscode
103103
*.code-workspace
104+
105+
# Test Script
106+
107+
test.sh

README.md

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,9 @@ leading to better products and faster delivery times.
7777
- macos-14 (arm64)
7878
- Ubuntu-22.04
7979

80-
Note: Currently, plugins are only compatible to use with **Appcircle Cloud**.
81-
**Self-hosted** support will be available in future releases.
80+
Note: Both **Appcircle Cloud** and **self-hosted** Appcircle installations are
81+
supported. See [Self-Hosted Appcircle](#self-hosted-appcircle) below to configure
82+
custom endpoints.
8283

8384
### Testing Distribution
8485

@@ -127,6 +128,39 @@ Local Action' with the appropriate information.
127128
- `message`: Your message to testers, ensuring they receive important updates
128129
and information regarding the application.
129130

131+
### Self-Hosted Appcircle
132+
133+
If you run a self-hosted Appcircle installation, point the action to your own
134+
servers with the optional `authEndpoint` and `apiEndpoint` inputs. When omitted,
135+
they default to the Appcircle cloud (`https://auth.appcircle.io` and
136+
`https://api.appcircle.io`), so existing cloud workflows keep working without any
137+
change.
138+
139+
```yaml
140+
- name: Publish App to Appcircle
141+
uses: appcircleio/appcircle-testing-distribution-githubaction
142+
with:
143+
personalAPIToken: ${{ secrets.AC_PROFLE_API_TOKEN }}
144+
profileName: ${{ secrets.AC_PROFILE_NAME }}
145+
createProfileIfNotExists: ${{ secrets.CREATE_PROFILE_IF_NOT_EXISTS }}
146+
appPath: ${{ secrets.APP_PATH }}
147+
message: ${{ secrets.MESSAGE }}
148+
authEndpoint: https://auth.your-appcircle-domain.com
149+
apiEndpoint: https://api.your-appcircle-domain.com
150+
```
151+
152+
- `authEndpoint`: Base URL of the self-hosted Appcircle authentication server.
153+
Optional; defaults to `https://auth.appcircle.io`.
154+
- `apiEndpoint`: Base URL of the self-hosted Appcircle API server. Optional;
155+
defaults to `https://api.appcircle.io`.
156+
157+
> **Self-signed or private CA certificates:** If your self-hosted Appcircle server
158+
> uses a self-signed certificate (or one issued by a private/internal CA), requests
159+
> will fail certificate validation. The action does not disable TLS verification.
160+
> Trust the server's CA on the runner — set the `NODE_EXTRA_CA_CERTS` environment
161+
> variable to a PEM file containing the CA certificate, or add the CA to the system
162+
> certificate store.
163+
130164
### Leveraging Environment Variables
131165

132166
Utilize environment variables seamlessly by substituting the parameters with

action.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,18 @@ inputs:
1313
description:
1414
'Provide Appcircle Personal API Token to authenticate Appcircle services.'
1515
required: true
16+
authEndpoint:
17+
description:
18+
'Optional: Authentication endpoint URL for self-hosted Appcircle
19+
installations. Defaults to the Appcircle cloud.'
20+
required: false
21+
default: 'https://auth.appcircle.io'
22+
apiEndpoint:
23+
description:
24+
'Optional: API endpoint URL for self-hosted Appcircle installations.
25+
Defaults to the Appcircle cloud.'
26+
required: false
27+
default: 'https://api.appcircle.io'
1628
profileName:
1729
description:
1830
'Enter the profile name of the Appcircle distribution profile. This name

0 commit comments

Comments
 (0)