Skip to content

Commit

Permalink
Try to fix ver check
Browse files Browse the repository at this point in the history
  • Loading branch information
richiejp committed Aug 21, 2024
1 parent 77d78a2 commit 984fff0
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,22 +57,31 @@ jobs:
release-dryrun:
runs-on: ubuntu-22.04
needs: [build-lint, build-cross, generate-src]
if: github.event_name == 'pull_request'
if: github.ref_type != 'tag'
steps:
- uses: actions/download-artifact@v4
- name: list artifacts
- id: prepare-artifacts
name: list artifacts
run: |
find
cd src
tar -czvf ../generated-src.tar.gz *
cd ../
mv src/go/version.txt ./
echo "ver=$(cat src/go/version.txt)" >> "$GITHUB_OUTPUT"
rm -r src
for d in cli-*; do
mv $d/ay ay-${d#cli-}
rmdir $d
done
find
- name: check-version
run: |
if [[ ${{ steps.prepare-artifacts.outputs.ver }} =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then
echo ok
else
echo "::error file=go/version.txt::Tag Incorrect version format"
exit 1
fi
release:
runs-on: ubuntu-22.04
Expand All @@ -84,18 +93,19 @@ jobs:
attestations: write
steps:
- uses: actions/download-artifact@v4
- name: prepare-artifacts
- id: prepare-artifacts
name: prepare artifacts
run: |
cd src
tar -czvf ../generated-src.tar.gz *
cd ../
echo ver=$(cat src/go/version.txt) | tee -a "$GITHUB_OUTPUT"
echo "ver=$(cat src/go/version.txt)" >> "$GITHUB_OUTPUT"
rm -r src
for d in cli-*; do
mv $d/ay ay-${d#cli-}
rmdir $d
done
- name: check-version
- name: check version
run: |
if [[ ${{ github.ref }} =~ ${{ steps.prepare-artifacts.outputs.ver }}$ ]]; then
echo ok
Expand Down

0 comments on commit 984fff0

Please sign in to comment.