-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Workflows for automated releases and github-pages builds #3137
Changes from all commits
61e5f83
88b21e1
b8718eb
096144c
cfaeff4
c8d87b0
95552af
7723aa3
b267bf9
cb0a34c
69267c6
fe811b3
3166143
27943a2
72fbc30
6a5594d
ec0b55a
476ef39
096b7eb
53d6fa7
28e6474
68db91e
ab6441f
8e0ea56
4b62cdb
f8505a4
9e016b9
29586d3
7ff878e
3581254
137f8f2
f707899
343aa60
e6b6c03
dd08c2b
0c6435c
1f8a086
83f9e67
b809d8f
5345ee2
719c9e3
4107f98
e3ffc89
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Deploy to GitHub Pages | ||
on: | ||
release: | ||
types: | ||
- published | ||
workflow_dispatch: | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: 'package.json' | ||
cache: 'npm' | ||
|
||
- name: Install Node dependencies | ||
run: npm ci | ||
|
||
- name: Build the package | ||
run: | | ||
ASSET_PATH=/kinto-admin/ npm run build | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: build/ | ||
|
||
deploy: | ||
needs: build | ||
permissions: | ||
pages: write | ||
id-token: write | ||
environment: | ||
name: github-pages | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Deploy to Github Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Create a release on tag | ||
on: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version-file: 'package.json' | ||
cache: 'npm' | ||
|
||
- name: Install Node dependencies | ||
run: npm ci | ||
|
||
- name: Build the package | ||
run: | | ||
npm run build:kinto-single | ||
cd build | ||
tar -cvf "$RUNNER_TEMP/kinto-admin-release.tar" * | ||
|
||
- name: Create release if one doesn't exist yet | ||
run: | | ||
EXISTING_RELEASE=$(gh release view $GITHUB_REF --json="id" || echo '') | ||
if [[ -z $EXISTING_RELEASE ]]; then | ||
gh release create $GITHUB_REF --generate-notes -d | ||
fi | ||
|
||
- name: Upload built package to release | ||
run: | | ||
gh release upload $GITHUB_REF "$RUNNER_TEMP/kinto-admin-release.tar" --clobber |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -163,15 +163,47 @@ If you use `target.merkle.tree.file.name` it will render the string | |
`foobar` and `target.proof.hash` will render `abcd`. | ||
|
||
## Releasing | ||
Releases can be created through the GitHub UI or through git command line. | ||
|
||
### Through GitHub UI | ||
1. Create a new release as normal | ||
2. When tagging your release, enter a standard version number like `vX.Y.Z` | ||
3. After the release is published (including pre-release), built assets will be attached as files, including: | ||
1. Source code based on the tagged commit | ||
2. A single-server build for kinto-admin in a tar file (this may take a few minutes to show up) | ||
|
||
### Through git commands | ||
1. Tag a commit with `git tag --annotate vX.Y.Z` (this will become the version number in the built release) | ||
2. Push the tag with `git push origin vX.Y.Z` or `git push origin --tags` | ||
3. A new release draft will be created automatically with built assets attached as files, including: | ||
1. Source code based on the tagged commit | ||
2. A single-server build for kinto-admin in a tar file | ||
1. This will have `ASSET_PATH=/v1/admin KINTO_ADMIN_SINGLE_SERVER=1` build property values | ||
2. This may take a few minutes to show up | ||
4. Update the release body with detailed information | ||
5. Publish the release when ready | ||
leplatrem marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Deploying to github-pages | ||
|
||
### Repo configuration for forks | ||
1. Enable github pages and allow deployment from github actions | ||
1. Go Settings > Pages | ||
2. Under "Build and deployment" choose Source > GitHub Actions | ||
2. Choose which branches should be allowed to deploy to pages | ||
1. Go Settings > Environments > Github Pages | ||
2. Under "Deployment branches and tags", configure which branches should be allowed to deploy to pages | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's something that I find unclear in these instructions... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Trying to make that clearer |
||
|
||
### Deployed automatically on release publish | ||
Github pages will automatically be updated upon release publishing. Version will be the tag created | ||
|
||
### Running the github action manually | ||
You can deploy to github pages manually for To deploy to github pages manually for any user acceptance testing you may want to do. | ||
1. Open Actions | ||
2. Select the "Deploy to Github Pages" action | ||
3. Select "Run workflow" and choose the branch you wish to build against | ||
4. Click "Run workflow" | ||
5. Kinto-admin will be deployed to `https://{owner}.github.io/kinto-admin` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
1. Bump the version number in `package.json` and run `npm i` to propagate that version to `package-lock.json` | ||
2. Commit with `git commit -a -m "Bump vX.Y.Z"` | ||
3. Create the tag with `git tag vX.Y.Z` | ||
4. Push the commit with `git push` | ||
5. Push the tag with `git push origin vX.Y.Z` | ||
6. Publish to GitHub Pages with `npm run publish-to-gh-pages` | ||
7. Draft a new release with the changelog | ||
8. Done! | ||
|
||
## License | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think we should explicitly mention that we're setting
ASSET_PATH
andSINGLE_SERVER
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Being verbose can't hurt. Will add.