-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub Actions workflow to automate releases (#40)
* Added beginnings of package building code * chore: create release CI job * chore: add documentation section to changelog * chore: make build-meshchat-package a reusable workflow * chore: add build packages to release * fix: update-version.sh can now be told version to set * chore(ci): convert meshchat-api build to reusable workflow * chore(ci): set release to only work on release branch Signed-off-by: Gerard Hickey <hickey@kinetic-compute.com>
- Loading branch information
Showing
9 changed files
with
683 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,29 @@ | ||
name: Build MeshChat API Package | ||
on: push | ||
env: | ||
IPK_DIR: package/meshchat-api-ipkg | ||
on: | ||
workflow_call: | ||
inputs: | ||
build_version: | ||
required: true | ||
type: string | ||
build_dir: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
create-meshchat-api-package: | ||
runs-on: ubuntu-latest | ||
# container: | ||
# image: registry.gitlab.com/wt0f/gitlab-runner-images/shell:latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: package/populate-meshchat-api-fs.sh $IPK_DIR | ||
- run: package/update-version.sh $IPK_DIR | ||
- run: package/ipk-build.sh $IPK_DIR | ||
- uses: actions/upload-artifact@v3 | ||
- uses: actions/checkout@v4 | ||
- run: echo ${{ inputs.build_version }} > VERSION | ||
- run: package/populate-meshchat-api-fs.sh ${{ inputs.build_dir }} | ||
- run: package/update-version.sh ${{ inputs.build_dir }} | ||
- run: package/ipk-build.sh ${{ inputs.build_dir }} | ||
- id: detect-package-file | ||
run: echo "file=$(ls -1 meshchat_*.ipk)" >> $GITHUB_OUTPUT | ||
- run: echo "${{ steps.detect-package-file.outputs.file }}" | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: meshchat-api | ||
path: meshchat-api_* | ||
name: ${{ steps.detect-package-file.outputs.file }} | ||
path: ${{ steps.detect-package-file.outputs.file }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,34 @@ | ||
name: Build MeshChat Package | ||
on: push | ||
env: | ||
IPK_DIR: package/meshchat-ipkg | ||
on: | ||
workflow_call: | ||
inputs: | ||
build_version: | ||
required: true | ||
type: string | ||
build_dir: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
create-meshchat-package: | ||
runs-on: ubuntu-latest | ||
# container: | ||
# image: registry.gitlab.com/wt0f/gitlab-runner-images/shell:latest | ||
outputs: | ||
package_file: ${{ steps.detect-package-file.outputs.file }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- run: package/populate-meshchat-fs.sh $IPK_DIR | ||
- run: package/update-version.sh $IPK_DIR | ||
- run: package/ipk-build.sh $IPK_DIR | ||
- uses: actions/upload-artifact@v3 | ||
- uses: actions/checkout@v4 | ||
# - run: info "Populating the filesystem with MeshChat files" | ||
- run: echo ${{ inputs.build_version }} > VERSION | ||
- run: package/populate-meshchat-fs.sh ${{ inputs.build_dir }} | ||
# - run: info "Updating version numbers to " | ||
- run: package/update-version.sh ${{ inputs.build_dir }} | ||
# - run: info "Packing up MeshChat files" | ||
- run: package/ipk-build.sh ${{ inputs.build_dir }} | ||
- id: detect-package-file | ||
run: echo "file=$(ls -1 meshchat_*.ipk)" >> $GITHUB_OUTPUT | ||
- run: echo "${{ steps.detect-package-file.outputs.file }}" | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: meshchat | ||
path: | | ||
meshchat_*.ipk | ||
VERSION | ||
name: ${{ steps.detect-package-file.outputs.file }} | ||
path: ${{ steps.detect-package-file.outputs.file }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: Release MeshChat Package | ||
on: | ||
pull_request: | ||
types: [closed] | ||
branches: [release] | ||
|
||
jobs: | ||
create-release: | ||
runs-on: ubuntu-latest | ||
# container: | ||
# image: registry.gitlab.com/wt0f/gitlab-runner-images/node:latest | ||
outputs: | ||
build_version: ${{ steps.detect_version.outputs.build_version }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.RELEASE_IT_TOKEN }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: git config | ||
run: | | ||
git config user.name "${GITHUB_ACTOR}" | ||
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | ||
- run: npm install -g release-it @release-it/conventional-changelog @commitlint/config-conventional @commitlint/cli auto-changelog | ||
- id: detect_version | ||
run: echo "build_version=$(npx release-it --release-version)" >> $GITHUB_OUTPUT | ||
- run: npx release-it -VV --ci | ||
- run: git checkout master | ||
- run: git rebase release | ||
- run: git push | ||
|
||
build-meshchat-package: | ||
needs: create-release | ||
uses: | ||
./.github/workflows/build-meshchat-package.yaml | ||
with: | ||
build_version: ${{ needs.create-release.outputs.build_version }} | ||
build_dir: package/meshchat-ipkg | ||
|
||
build-meshchat-api-package: | ||
needs: create-release | ||
uses: | ||
./.github/workflows/build-meshchat-api-package.yaml | ||
with: | ||
build_version: ${{ needs.create-release.outputs.build_version }} | ||
build_dir: package/meshchat-ipkg | ||
|
||
add-meshchat-package-to-release: | ||
needs: | ||
- build-meshchat-package | ||
- build-meshchat-api-package | ||
# container: | ||
# image: registry.gitlab.com/wt0f/gitlab-runner-images/node:latest | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
fetch-tags: true | ||
- run: git pull | ||
- run: npm install -g release-it @release-it/conventional-changelog @commitlint/config-conventional @commitlint/cli auto-changelog | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: ${{ needs.release_meshchat_package.outputs.package_file }} | ||
path: ${{ needs.release_meshchat_package.outputs.package_file }} | ||
- run: | | ||
for file in *.ipk; do | ||
echo "uploading $file" | ||
npx release-it --ci --no-increment --no-git --no-npm --github.update=true --github.assets=$file | ||
done | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.RELEASE_IT_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.