Skip to content

set current version, not next when using git tags #78

set current version, not next when using git tags

set current version, not next when using git tags #78

Workflow file for this run

name: build
on:
push:
branches:
- v*
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Git Checkout
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '1.20.x'
- name: Build
env:
gh_ci_key: ${{ secrets.GH_CI_KEY }}
ziti_ci_gpg_key: ${{ secrets.ZITI_CI_GPG_KEY }}
ziti_ci_gpg_key_id: ${{ secrets.ZITI_CI_GPG_KEY_ID }}
run: |
mkdir -p tmp
go build -o tmp ./...
./tmp/ziti-ci configure-git
./tmp/ziti-ci generate-build-info cmd/build_info.go cmd
go build -o tmp ./...
echo "ZITI_CI_VERSION=$(./tmp/ziti-ci get-next-version -q)" >> $GITHUB_ENV
./tmp/ziti-ci tag -v -f version
- name: Publish
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ env.ZITI_CI_VERSION }}
release_name: Release ${{ env.ZITI_CI_VERSION }}
draft: false
prerelease: false
- name: Upload Ziti CI
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./tmp/ziti-ci
asset_name: ziti-ci
asset_content_type: application/octet-stream