Skip to content

Commit

Permalink
Update GH workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
zulh-civo committed Sep 23, 2021
1 parent 9074a04 commit 3e19079
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 52 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Prepare release

on:
workflow_dispatch:
inputs:
newVersionTag:
description: 'New version tag (e.g. v0.10.11)'
required: true

jobs:
prepare_release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Unshallow
run: git fetch --prune --unshallow

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16.x

- name: Install and run tfplugindocs CLI
run: |
mkdir downloads
cd downloads
wget https://github.com/hashicorp/terraform-plugin-docs/releases/download/v0.5.0/tfplugindocs_0.5.0_linux_amd64.zip
unzip tfplugindocs_0.5.0_linux_amd64.zip
cd ..
mv downloads/tfplugindocs .
./tfplugindocs generate
rm -rf ./tfplugindocs downloads
- name: Install and run auto-changelog CLI
run: |
npm i -g [email protected]
auto-changelog --config=.auto-changelog-config
- name: Add and commit generated docs and CHANGELOG.md
uses: test-room-7/action-update-file@v1
with:
branch: master
commit-msg: Update docs and CHANGELOG.md
file-path: |
docs/**/*.md
examples/**/*.tf
examples/**/*.sh
CHANGELOG.md
github-token: ${{ secrets.GHTOKEN }}

- name: Create tag
uses: negz/create-tag@v1
with:
version: ${{ github.event.inputs.newVersionTag }}
token: ${{ secrets.GHTOKEN }}
55 changes: 3 additions & 52 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,69 +6,20 @@ on:
- 'v*.*.*'

jobs:
docs-and-changelog:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Unshallow
run: |
git fetch --prune --unshallow
echo "Current branch name is: $(git branch --show-current)"
echo "Latest hash is: $(git rev-parse HEAD)"
run: git fetch --prune --unshallow

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16.x

- name: Install and run tfplugindocs CLI
run: |
mkdir downloads
cd downloads
wget https://github.com/hashicorp/terraform-plugin-docs/releases/download/v0.5.0/tfplugindocs_0.5.0_linux_amd64.zip
unzip tfplugindocs_0.5.0_linux_amd64.zip
cd ..
mv downloads/tfplugindocs .
./tfplugindocs generate
rm -rf ./tfplugindocs downloads
- name: Install and run auto-changelog CLI
run: |
npm i -g [email protected]
auto-changelog --config=.auto-changelog-config
- name: Add and commit generated docs and CHANGELOG.md
uses: test-room-7/action-update-file@v1
with:
branch: master
commit-msg: Update docs and CHANGELOG.md
file-path: |
docs/**/*.md
examples/**/*.tf
examples/**/*.sh
CHANGELOG.md
github-token: ${{ secrets.GHTOKEN }}

goreleaser:
needs: docs-and-changelog
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Pull latest changes (docs and CHANGELOG.md)
run: |
git pull origin master
echo "Current branch name is: $(git branch --show-current)"
echo "Latest hash is: $(git rev-parse HEAD)"

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16.x

- name: Import GPG key
id: import_gpg
uses: paultyng/[email protected]
Expand Down

0 comments on commit 3e19079

Please sign in to comment.