Skip to content

Release

Release #75

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
bumpType:
description: "Bump Type"
required: true
type: choice
default: patch
options:
- patch
- minor
- major
jobs:
release-version:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
path: src
- name: Tar source
run: |
pushd src
tar --exclude-ignore=.tarignore -czvf ../bazel-terraform-rules.tar.gz .
popd
echo "::set-output name=SRC_SHA256::$(sha256sum bazel-terraform-rules.tar.gz | cut -d " " -f 1)"
echo "::set-output name=TAR_PATH::$(realpath bazel-terraform-rules.tar.gz)"
id: tar
- name: Test tar
run: |
src/.github/workflows/release/scripts/local-release-test.sh "${{steps.tar.outputs.TAR_PATH}}" "${{steps.tar.outputs.SRC_SHA256}}"
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
default_bump: "${{inputs.bumpType}}"
tag_prefix: ""
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Rename tar with tag
run: |
mv ${{steps.tar.outputs.TAR_PATH}} bazel-terraform-rules-${{steps.tag_version.outputs.new_tag}}.tar.gz
- name: "Build Changelog"
id: build_changelog
uses: mikepenz/release-changelog-builder-action@v3
with:
commitMode: true
configurationJson: |
{
"template": "#{{CHANGELOG}}\n\n<details>\n<summary>Changes</summary>\n\n#{{UNCATEGORIZED}}\n</details>",
"pr_template": "* #{{MERGE_SHA}}: #{{TITLE}}",
"categories": [
{
"title": "## 🚀 Features",
"labels": ["feature"]
}
]
}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Installation instructions
id: installation
run: |
src/.github/workflows/release/scripts/installation-code.sh "https://github.com/theothertomelliott/bazel-terraform-rules/releases/download/${{steps.tag_version.outputs.new_tag}}/bazel-terraform-rules-${{steps.tag_version.outputs.new_tag}}.tar.gz" ${{steps.tar.outputs.SRC_SHA256}} > instructions.txt
- name: "Read Load instructions into variable"
id: instructions
uses: andstor/file-reader-action@v1
with:
path: "instructions.txt"
- name: Create Release
uses: softprops/[email protected]
with:
files: bazel-terraform-rules-${{steps.tag_version.outputs.new_tag}}.tar.gz
tag_name: "${{steps.tag_version.outputs.new_tag}}"
body: |
# Adding to your Workspace
To use this version, add the following lines to your `WORKSPACE` file:
```
${{steps.instructions.outputs.contents}}
```
# Changelog
${{steps.build_changelog.outputs.changelog}}
- name: Verify instructions
run: |
src/.github/workflows/release/scripts/test-instructions.sh "$(cat instructions.txt)"