Skip to content

Commit

Permalink
ci: use TinyGo version in artifact files
Browse files Browse the repository at this point in the history
This avoids needing to rename them ourselves (which is kinda annoying)
and also avoids mistakes in the process.
  • Loading branch information
aykevl committed Oct 26, 2024
1 parent 2a76ceb commit 0815761
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@ jobs:
uses: actions/checkout@v4
with:
submodules: true
- name: Get TinyGo version
id: version
run: ./.github/workflows/tinygo-extract-version.sh >> "$GITHUB_OUTPUT"
- name: TEST use version ${{ steps.version.outputs.version }}
uses: actions/upload-artifact@v4
with:
name: linux-amd64-${{ steps.version.outputs.version }}-double-zipped
path: |
/tmp/tinygo${{ steps.version.outputs.version }}.linux-amd64.tar.gz
/tmp/tinygo_${{ steps.version.outputs.version }}_amd64.deb
- name: exit
run: program-does-not-exist
- name: Cache Go
uses: actions/cache@v4
with:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/tinygo-extract-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

# Extract the version string from the source code, to be stored in a variable.
grep 'const version' goenv/version.go | sed 's/^const version = "\(.*\)"$/version=\1/g'

0 comments on commit 0815761

Please sign in to comment.