-
Notifications
You must be signed in to change notification settings - Fork 9
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
Showing
1 changed file
with
17 additions
and
37 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,7 +1,8 @@ | ||
name: update version and create new release | ||
on: | ||
release: | ||
types: [published] | ||
push: | ||
branches: | ||
- master | ||
paths-ignore: | ||
- '.github/**' | ||
- 'configs/**' | ||
|
@@ -21,28 +22,13 @@ jobs: | |
uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.GH_TOKEN }} | ||
- name: Check version file existence | ||
run: | | ||
if [ ! -f ./version ]; then | ||
echo "Error: version file does not exist." | ||
exit 1 | ||
fi | ||
echo "version file exists." | ||
- name: Print version file content | ||
run: | | ||
echo "version file content:" | ||
cat ./version | ||
- name: Increase Version | ||
run: | | ||
version=$(cat ./version | grep -o -e '[0-9]\{1,2\}\.[0-9]\{1,2\}\.[0-9]\{1,2\}') | ||
major=$(echo "$version" | cut -d'.' -f1) | ||
minor=$(echo "$version" | cut -d'.' -f2) | ||
patch=$(echo "$version" | cut -d'.' -f3) | ||
echo "Major version: $major" | ||
echo "Minor version: $minor" | ||
echo "Patch version: $patch" | ||
if [[ $patch -lt 99 ]]; then | ||
((patch++)) | ||
elif [[ $minor -lt 99 ]]; then | ||
|
@@ -65,10 +51,9 @@ jobs: | |
run: | | ||
git config --global user.name ShiranAvidov | ||
git config --global user.email [email protected] | ||
git checkout -b add-user-agent-header | ||
git add ./version | ||
git commit -m "update version" | ||
git push origin add-user-agent-header | ||
git push | ||
outputs: | ||
VERSION: ${{ steps.version.outputs.VERSION }} | ||
|
||
|
@@ -79,18 +64,13 @@ jobs: | |
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set User-Agent Headers | ||
id: set-headers | ||
run: | | ||
RELEASE_VERSION="${{ needs.update_version.outputs.VERSION }}" | ||
echo "release_version=$RELEASE_VERSION" >> $GITHUB_ENV | ||
- name: Update version file | ||
run: | | ||
echo "${{ needs.update_version.outputs.VERSION }}" >./version | ||
# - name: Push tag | ||
# run: | | ||
# git tag "${{ needs.update_version.outputs.VERSION }}" | ||
# git push origin "${{ needs.update_version.outputs.VERSION }}" | ||
- name: Push tag | ||
run: | | ||
git tag "${{ needs.update_version.outputs.VERSION }}" | ||
git push origin "${{ needs.update_version.outputs.VERSION }}" | ||
- name: Install zip | ||
run: | | ||
sudo apt-get install zip -y | ||
|
@@ -127,12 +107,12 @@ jobs: | |
tar -czvf assets/mac_kubernetes_gke.tar.gz -C datasources/mac kubernetes/gke -C ${GITHUB_WORKSPACE} resources -C ${GITHUB_WORKSPACE} resources-mac | ||
tar -czvf assets/mac_kubernetes_digitalocean.tar.gz -C datasources/mac kubernetes/digitalocean -C ${GITHUB_WORKSPACE} resources -C ${GITHUB_WORKSPACE} resources-mac | ||
tar -czvf assets/mac_localhost_mac.tar.gz -C datasources/mac localhost/mac -C ${GITHUB_WORKSPACE} resources -C ${GITHUB_WORKSPACE} resources-mac | ||
# - name: Create Release | ||
# uses: ncipollo/release-action@v1 | ||
# with: | ||
# token: ${{ secrets.GITHUB_TOKEN }} | ||
# tag: ${{ needs.update_version.outputs.VERSION }} | ||
# name: ${{ needs.update_version.outputs.VERSION }} | ||
# body: | | ||
# New Release ${{ needs.update_version.outputs.VERSION }} | ||
# artifacts: "assets/**" | ||
- name: Create Release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
tag: ${{ needs.update_version.outputs.VERSION }} | ||
name: ${{ needs.update_version.outputs.VERSION }} | ||
body: | | ||
New Release ${{ needs.update_version.outputs.VERSION }} | ||
artifacts: "assets/**" |