-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
25aec12
commit 151ca40
Showing
5 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
Empty 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,19 @@ | ||
name: main | ||
on: | ||
push: | ||
branches: [ main ] | ||
workflow_dispatch: | ||
permissions: | ||
contents: write | ||
jobs: | ||
# test: | ||
# name: test | ||
# uses: ./.github/workflows/step-test.yaml | ||
release: | ||
# needs: test | ||
name: release | ||
uses: ./.github/workflows/step-release.yaml | ||
merge: | ||
needs: release | ||
name: merge | ||
uses: ./.github/workflows/step-merge.yaml |
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,17 @@ | ||
name: merge | ||
on: | ||
workflow_call: | ||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout 🛎️ | ||
uses: actions/checkout@v3 | ||
- name: Merge into Develop ➡️ | ||
uses: devmasx/merge-branch@master | ||
with: | ||
type: now | ||
from_branch: main | ||
target_branch: develop | ||
message: Merge version bump into develop | ||
github_token: ${{ secrets.GITHUB_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: release | ||
on: | ||
workflow_call: | ||
jobs: | ||
release: | ||
concurrency: ci-${{ github.ref }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout 🛎️ | ||
uses: actions/checkout@v3 | ||
- name: Set-up User 🐵 | ||
uses: fregante/setup-git-user@v2 | ||
- name: Bump and Tag 🏷️ | ||
run: | | ||
npm version patch | ||
git tag "$(cat package.json | jq -r '.version')" -m "[release] planetary-defence-$(cat package.json | jq -r '.version')" | ||
git push origin "$(cat package.json | jq -r '.version')" | ||
echo "VERSION=$(cat package.json | jq -r '.version')" >> $GITHUB_ENV | ||
echo "MAJOR=$(cat package.json | jq -r '.version' | cut -d "." -f 1)" >> $GITHUB_ENV | ||
echo "MINOR=$(cat package.json | jq -r '.version' | cut -d "." -f 2)" >> $GITHUB_ENV | ||
echo "PATCHED=$((1 + $(cat package.json | jq -r '.version' | cut -d "." -f 3) ))" >> $GITHUB_ENV | ||
# Note :: an env var cannot be accessed from a step that defines or updates it | ||
- name: Release 📦 | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
tag_name: ${{ env.VERSION }} | ||
- name: Add -SNAPSHOT 📷 | ||
run: | | ||
jq '.version="${{ env.MAJOR }}.${{ env.MINOR }}.${{ env.PATCHED }}-SNAPSHOT"' package.json > /tmp/package.json | ||
mv /tmp/package.json package.json | ||
- name: Commit -SNAPSHOT 💾 | ||
uses: stefanzweifel/git-auto-commit-action@v4 |
Empty file.