display golang version and update golang #8
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: | | |
aria2c https://go.dev/dl/go1.22.5.linux-amd64.tar.gz -o ./go1.22.5.linux-amd64.tar.gz | |
sudo rm -rf /usr/local/go | |
echo --- | |
ls /usr/local/ | |
echo --- | |
sudo rm -f /usr/bin/go | |
ls /usr/bin/ | |
echo --- | |
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: | | |
whereis go | |
- name: Display again | |
run: | | |
/usr/local/go/bin/go version | |
go version |