Skip to content

Commit

Permalink
Fix workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisleekr committed Mar 19, 2021
1 parent 2b2676d commit 28bfea4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 15 deletions.
23 changes: 13 additions & 10 deletions .github/workflows/2-bump-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,22 @@ jobs:
steps:
- name: Checkout source code
uses: actions/checkout@v2
with:
# NOTE @v2 uses the token as an auth http header. Set it to
# a Personal Access Token instead of secrets.GITHUB_TOKEN
# so that tag pushes trigger repo push events.
token: ${{ secrets.MY_GITHUB_ACCESS_TOKEN }}
- name: Bump Version (Patch)
- id: bump-version
name: Bump Version (Patch)
if:
github.repository == 'chrisleekr/binance-trading-bot' && github.ref ==
'refs/heads/master'
run: |
git config --global user.email "${{ secrets.GIT_CI_EMAIL }}"
git config --global user.name "${{ secrets.GIT_CI_NAME }}"
git config --global user.name "$GITHUB_ACTOR"
PACKAGE_VERSION=$(npm version patch -m "Update version to %s [skip ci]")
git status
git push https://${{ secrets.GIT_CI_USERNAME }}:${{ secrets.GIT_CI_PASSWORD }}@${{ secrets.GIT_REPO_DOMAIN }}/chrisleekr/binance-trading-bot.git HEAD:$GITHUB_REF
git push https://${{ secrets.GIT_CI_USERNAME }}:${{ secrets.GIT_CI_PASSWORD }}@${{ secrets.GIT_REPO_DOMAIN }}/chrisleekr/binance-trading-bot.git $PACKAGE_VERSION
git push https://$GITHUB_ACTOR:${{ secrets.GIT_CI_PASSWORD }}@${{ secrets.GIT_REPO_DOMAIN }}/chrisleekr/binance-trading-bot HEAD:$GITHUB_REF
git push https://$GITHUB_ACTOR:${{ secrets.GIT_CI_PASSWORD }}@${{ secrets.GIT_REPO_DOMAIN }}/chrisleekr/binance-trading-bot $PACKAGE_VERSION
echo "::set-output name=PACKAGE_VERSION::$PACKAGE_VERSION"
- name: Trigger release workflow
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.GIT_CI_PASSWORD }}
event-type: Release
client-payload:
'{"ref": "${{ steps.bump-version.outputs.PACKAGE_VERSION }}"}'
12 changes: 7 additions & 5 deletions .github/workflows/3-release.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: 3. Release

on:
push:
tags:
- 'v*'
repository_dispatch:
types: [Release]

jobs:
create-release:
Expand All @@ -12,14 +11,17 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: ${{ github.event.client_payload.ref }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
tag_name: ${{ github.event.client_payload.ref }}
release_name:
'<Update release name for ${{ github.event.client_payload.ref }}>'
draft: true
prerelease: false
- name: Build/Push production docker image
Expand Down

0 comments on commit 28bfea4

Please sign in to comment.