Skip to content

goreleaser-bump

goreleaser-bump #48

name: goreleaser-bump
on:
workflow_dispatch:
inputs:
tag:
jobs:
goreleaser-bump:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
persist-credentials: true
- run: git checkout master
- name: Setup git config
run: |
git config --global user.name github-actions
git config --global user.email "github-actions@github.com"
- name: Setup env
uses: c-py/action-dotenv-to-setenv@v3
with:
env-file: .env
- name: Goreleaser version
run: |
GORELEASER_VER=${{ github.event.inputs.tag }}
echo "GORELEASER_VER=${GORELEASER_VER#v}" >> $GITHUB_ENV
- name: set new version
run: |
sed -i -e "s/GORELEASER_VERSION=${{ env.GORELEASER_VERSION }}/GORELEASER_VERSION=${{ env.GORELEASER_VER }}/g" .env
- name: Commit new version
run: |
if git add .env > /dev/null 2>&1; then
git commit -m "feat: bump goreleaser to v${{ env.GORELEASER_VER }}"
git push origin master
fi
notify-goreleaser-bump:
runs-on: ubuntu-latest
needs:
- goreleaser-bump
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup env
uses: c-py/action-dotenv-to-setenv@v3
with:
env-file: .env
- name: Get version
run: |
echo "RELEASE_TAG=v${GO_VERSION}" >> $GITHUB_ENV
- name: Notify goreleaser-cross with new release
uses: benc-uk/workflow-dispatch@v1
with:
workflow: goreleaser
inputs: '{ "tag" : "${{ env.RELEASE_TAG }}" }'
notify-goreleaser-pro-bump:
runs-on: ubuntu-latest
needs:
- goreleaser-bump
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup env
uses: c-py/action-dotenv-to-setenv@v3
with:
env-file: .env
- name: Get version
run: |
echo "RELEASE_TAG=v${GO_VERSION}" >> $GITHUB_ENV
- name: Notify goreleaser-cross-pro with new release
uses: benc-uk/workflow-dispatch@v1
with:
workflow: goreleaser-pro
inputs: '{ "tag" : "${{ env.RELEASE_TAG }}" }'