push #2
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
name: PUSH Workflow | |
on: | |
push: | |
branches: | |
- new_branch | |
jobs: | |
Test_job: | |
runs-on: ubuntu-latest | |
environment: test | |
steps: | |
- | |
name: Check out repository code | |
uses: actions/checkout@v4 | |
- | |
name: Fetching GO version from repo | |
run: echo "GO_VERSION=$(cat .go-version)" >> $GITHUB_ENV | |
- | |
name: Setup GO environment | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
- | |
name: Create Release Info | |
run: | | |
SDK_VERSION=$(cat .sdk-version) | |
CURRENT_TIME=$(date +'%Y%m%d%H%M%S') | |
COMMIT_ID=$(git rev-parse --short "$GITHUB_SHA") | |
OLD_RELEASE_VERSION=$(git ls-remote --tags | cut -d/ -f3- | cut -d- -f1 | tail -1) | |
if [ "$OLD_RELEASE_VERSION" = "$SDK_VERSION" ]; then echo "Release version not incremented"; exit 1; fi | |
echo "RELEASE_VERSION=${SDK_VERSION}-${CURRENT_TIME}-${COMMIT_ID}" >> $GITHUB_ENV | |
- | |
name: Run Go | |
run: go run main.go | |
env: | |
SECRET_KEY: ${{ secrets.SECRET_KEY }} | |
# - | |
# name: Update release version using go generate | |
# run: go generate ./internal/version | |
# - | |
# name: Setup git config for creating Tag | |
# run: | | |
# git config user.name "GitHub Actions" | |
# git config user.email "<>" | |
# - | |
# name: Update sdk version and create Tag | |
# run: | | |
# git add internal/version/version_generated.go | |
# git commit -m "version updated" | |
# git tag ${{ env.RELEASE_VERSION }} | |
# git push origin ${{ env.RELEASE_VERSION }} | |
# - | |
# name: Create Release | |
# uses: actions/create-release@latest | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# with: | |
# tag_name: ${{ env.RELEASE_VERSION }} | |
# release_name: ${{ env.RELEASE_VERSION }} | |
# draft: false | |
# prerelease: false |