-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adding release on main and develop branches for release-it cont…
…ainerized #5
- Loading branch information
1 parent
fe9a588
commit 49ae0cf
Showing
1 changed file
with
56 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
--- | ||
name: Release | ||
on: | ||
push: | ||
branches: ["main", "develop"] | ||
|
||
jobs: | ||
release_options: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
release_options: ${{ steps.release_options.outputs.release_options }} | ||
steps: | ||
- id: release_options | ||
name: Release options | ||
run: | | ||
release_options="--git.tagExclude='*[-]*'" | ||
branch=$(echo ${{ github.ref }} | awk -F'/' '{print $NF}') | ||
if [ -n "$branch" ] && [ "$branch" = "develop" ]; then | ||
release_options="--preRelease=beta" | ||
fi | ||
echo "release_options=$release_options" >> "$GITHUB_OUTPUT" | ||
release: | ||
runs-on: ubuntu-latest | ||
needs: release_options | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Build the Image | ||
run: docker build --tag ghcr.io/${{ github.repository }}:${{ github.sha }} . | ||
- name: Running release | ||
run: | | ||
docker run \ | ||
-e GITHUB_TOKEN=${GITHUB_TOKEN} \ | ||
-e GIT_DIRECTORY="/app" \ | ||
-e GIT_EMAIL=${GIT_EMAIL} \ | ||
-e GIT_USERNAME="${GIT_USERNAME}" \ | ||
-e GPG_PRIVATE_KEY="${GPG_PRIVATE_KEY}" \ | ||
-e GPG_PRIVATE_KEY_ID="${GPG_PRIVATE_KEY_ID}" \ | ||
-e RELEASE_IT_PLUGINS="@release-it/conventional-changelog@latest,@release-it/bumper@latest" \ | ||
-e SSH_PRIVATE_KEY_FILE="${SSH_PRIVATE_KEY_FILE}" \ | ||
-u root \ | ||
-v $PWD:/app \ | ||
ghcr.io/${{ github.repository }}:${{ github.sha }} \ | ||
release-it --ci ${{needs.release_options.outputs.release_options}} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PROJECT_GITHUB_TOKEN }} | ||
GIT_EMAIL: ${{ vars.GIT_EMAIL }} | ||
GIT_USERNAME: ${{ vars.GIT_USERNAME }} | ||
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | ||
GPG_PRIVATE_KEY_ID: ${{ secrets.GPG_PRIVATE_KEY_ID }} | ||
SSH_PRIVATE_KEY_FILE: ${{ secrets.SSH_PRIVATE_KEY_FILE }} |