Added support for MMDB Country format #3
Workflow file for this run
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
# Build and release binaries | |
name: Release to Github | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
permissions: | |
contents: write | |
packages: write | |
jobs: | |
release: | |
name: Release to Github | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set Up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.18' | |
- name: Extract Version | |
run: | | |
# Get the tag name from the event payload | |
TAG_NAME=${{ github.ref_name }} | |
# Use a regular expression to extract the version | |
if [[ $TAG_NAME =~ ^v([0-9]+\.[0-9]+\.[0-9]+)$ ]]; then | |
CLI_NAME="ip2convert" | |
CLI_VERSION="${BASH_REMATCH[1]}" | |
echo "CLI Name: $CLI_NAME" | |
echo "CLI Version: $CLI_VERSION" | |
# Add to github env | |
echo "CLI_NAME=$CLI_NAME" >> $GITHUB_ENV | |
echo "CLI_VERSION=$CLI_VERSION" >> $GITHUB_ENV | |
else | |
echo "Invalid tag format: $TAG_NAME" | |
echo "Tag should contain major/minor/patch versions e.g. v1.2.3" | |
exit 1 | |
fi | |
- name: Build | |
run: ./scripts/create-downloads.sh ${{ env.CLI_NAME }} ${{ env.CLI_VERSION }} | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
./build/${{ env.CLI_NAME }}_${{ env.CLI_VERSION }}*.tar.gz | |
./build/${{ env.CLI_NAME }}_${{ env.CLI_VERSION }}*.zip | |
./build/${{ env.CLI_NAME }}-${{ env.CLI_VERSION }}*.deb |