-
Notifications
You must be signed in to change notification settings - Fork 909
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: use TinyGo version in artifact files
This avoids needing to rename them ourselves (which is kinda annoying) and also avoids mistakes in the process.
- Loading branch information
Showing
4 changed files
with
46 additions
and
25 deletions.
There are no files selected for viewing
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
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
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
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' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,8 @@ concurrency: | |
jobs: | ||
build-windows: | ||
runs-on: windows-2022 | ||
outputs: | ||
version: ${{ steps.version.outputs.version }} | ||
steps: | ||
- name: Configure pagefile | ||
uses: al-cheb/[email protected] | ||
|
@@ -32,6 +34,10 @@ jobs: | |
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- name: Get TinyGo version | ||
id: version | ||
shell: bash | ||
run: ./.github/workflows/tinygo-extract-version.sh >> "$GITHUB_OUTPUT" | ||
- name: Install Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
|
@@ -108,7 +114,7 @@ jobs: | |
- name: Make release artifact | ||
shell: bash | ||
working-directory: build/release | ||
run: 7z -tzip a release.zip tinygo | ||
run: 7z -tzip a tinygo${{ steps.version.outputs.version }}.windows-amd64.zip tinygo | ||
- name: Publish release artifact | ||
# Note: this release artifact is double-zipped, see: | ||
# https://github.com/actions/upload-artifact/issues/39 | ||
|
@@ -118,8 +124,8 @@ jobs: | |
# We're doing the former here, to keep artifact uploads fast. | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: windows-amd64-double-zipped | ||
path: build/release/release.zip | ||
name: windows-amd64-double-zipped-${{ steps.version.outputs.version }} | ||
path: build/release/tinygo${{ steps.version.outputs.version }}.windows-amd64.zip | ||
|
||
smoke-test-windows: | ||
runs-on: windows-2022 | ||
|
@@ -148,12 +154,12 @@ jobs: | |
- name: Download TinyGo build | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: windows-amd64-double-zipped | ||
name: windows-amd64-double-zipped-${{ needs.build-windows.outputs.version }} | ||
path: build/ | ||
- name: Unzip TinyGo build | ||
shell: bash | ||
working-directory: build | ||
run: 7z x release.zip -r | ||
run: 7z x tinygo*.windows-amd64.zip -r | ||
- name: Smoke tests | ||
shell: bash | ||
run: make smoketest TINYGO=$(PWD)/build/tinygo/bin/tinygo | ||
|
@@ -178,12 +184,12 @@ jobs: | |
- name: Download TinyGo build | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: windows-amd64-double-zipped | ||
name: windows-amd64-double-zipped-${{ needs.build-windows.outputs.version }} | ||
path: build/ | ||
- name: Unzip TinyGo build | ||
shell: bash | ||
working-directory: build | ||
run: 7z x release.zip -r | ||
run: 7z x tinygo*.windows-amd64.zip -r | ||
- name: Test stdlib packages | ||
run: make tinygo-test TINYGO=$(PWD)/build/tinygo/bin/tinygo | ||
|
||
|
@@ -214,11 +220,11 @@ jobs: | |
- name: Download TinyGo build | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: windows-amd64-double-zipped | ||
name: windows-amd64-double-zipped-${{ needs.build-windows.outputs.version }} | ||
path: build/ | ||
- name: Unzip TinyGo build | ||
shell: bash | ||
working-directory: build | ||
run: 7z x release.zip -r | ||
run: 7z x tinygo*.windows-amd64.zip -r | ||
- name: Test stdlib packages on wasip1 | ||
run: make tinygo-test-wasip1-fast TINYGO=$(PWD)/build/tinygo/bin/tinygo |