Updates for the v1.3.0 release. #18
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
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with | |
# the License. A copy of the License is located at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR | |
# CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions | |
# and limitations under the License. | |
name: Create Release | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
release: | |
name: Upload Release Asset | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: 'stable' | |
cache: false | |
env: | |
GO111MODULE: on | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set env | |
run: | | |
echo "VERSION=$(echo ${GITHUB_REF#refs/*/} | cut -c 2-)" >> $GITHUB_ENV | |
- name: Install docker | |
run: | | |
sudo apt-get update | |
sudo apt install --assume-yes apt-transport-https ca-certificates curl software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable" | |
sudo apt-get install --assume-yes docker-ce docker-ce-cli containerd.io | |
sudo apt-get install -y hub | |
- name: Build docker image | |
run: | | |
docker build . -t timestream-prometheus-connector-docker | |
docker save timestream-prometheus-connector-docker | gzip > timestream-prometheus-connector-docker-image-$VERSION.tar.gz | |
- name: Build binaries | |
run: | | |
python3 ./package.py -v $VERSION | |
- name: Create the release | |
run: | | |
set -x | |
assets=() | |
for asset in ./*.tar.gz; do | |
assets+=("-a" "$asset") | |
done | |
for asset in ./*.zip; do | |
assets+=("-a" "$asset") | |
done | |
tag_name="${GITHUB_REF##*/}" | |
hub release create -p "${assets[@]}" -m "$tag_name" "$tag_name" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |