display golang version and update golang #5
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
name: display golang version and update golang | |
on: | |
workflow_dispatch: | |
jobs: | |
to-build: | |
name: Display golang version and update golang | |
runs-on: ubuntu-latest | |
steps: | |
- name: Display | |
run: | | |
go version | |
- name: Update | |
run: | | |
sudo apt-get install -y aria2 | |
aria2c https://go.dev/dl/go1.22.5.linux-amd64.tar.gz -o ./go1.22.5.linux-amd64.tar.gz | |
rm -rf /usr/local/go | |
sudo tar -C /usr/local/ -xzf go1.22.5.linux-amd64.tar.gz | |
- name: Edit the environment | |
run: | | |
echo $PATH | |
if [ -d "/usr/local/go/bin" ] ; then | |
PATH="/usr/local/go/bin:$PATH" | |
fi | |
export PATH=$PATH | |
echo $PATH | |
- name: Where go | |
run: | | |
where go | |
- name: Display again | |
run: | | |
/usr/local/go/bin/go version | |
go version |