Version Index #6
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
# .github/workflows/version-index.yml | |
name: Version Index | |
on: | |
push: | |
tags: | |
- '*' | |
workflow_dispatch: | |
inputs: | |
package_version: | |
description: "Version of the package to fetch" | |
required: false | |
default: "" | |
jobs: | |
go-get: | |
name: Install Go Package with Released Version | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v2 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.21.5 | |
- name: Determine Package Version | |
id: package_version | |
run: | | |
if [ "${GITHUB_EVENT_NAME}" = "push" ]; then | |
echo "PACKAGE_VERSION=${GITHUB_REF_NAME}" >> $GITHUB_ENV | |
else | |
if [ -n "${{ github.event.inputs.package_version }}" ]; then | |
echo "PACKAGE_VERSION=${{ github.event.inputs.package_version }}" >> $GITHUB_ENV | |
else | |
LATEST_TAG=$(git describe --tags --abbrev=0) | |
echo "PACKAGE_VERSION=${LATEST_TAG}" >> $GITHUB_ENV | |
fi | |
shell: bash | |
- name: Install Package | |
run: | | |
if [ -z "${{ env.PACKAGE_VERSION }}" ]; then | |
echo "No version provided." | |
exit 1 | |
fi | |
GOPROXY=https://proxy.golang.org GO111MODULE=on go get github.com/i5heu/ouroboros-db@${{ env.PACKAGE_VERSION }} |