Skip to content

Commit

Permalink
update actions, use the new outputs syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
ftl committed May 16, 2023
1 parent 07fe555 commit 527cf3d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,26 @@ jobs:
build:
name: Build
runs-on: ubuntu-22.04
outputs:
version_number: ${{ steps.build.outputs.version_number }}
steps:
- name: Install Linux packages
run: sudo apt update && sudo apt install -y --no-install-recommends libgtk-3-0 libgtk-3-dev libpango-1.0-0 libpango1.0-dev libpangocairo-1.0-0

- name: Set up Go 1.20
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: '1.20'
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Get Gtk version and the environment
run: pkg-config --modversion gtk+-3.0;env

- name: Caching build artifacts and modules
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
Expand All @@ -42,13 +44,13 @@ jobs:
id: build
run: |
make deps test build
echo "::set-output name=version_number::$(./hellocontest version)"
echo "version_number=$(./hellocontest version)" >> $GITHUB_OUTPUT
- name: Show Version
run: echo "Version ${{ steps.build.outputs.version_number }}"

- name: 'Upload binary for linux_x86_64'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: hellocontest-binary
path: ./hellocontest
15 changes: 9 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,29 @@ jobs:
build:
name: Build
runs-on: ubuntu-22.04
outputs:
version_number: ${{ steps.build.outputs.version_number }}
package_name: ${{ steps.package_filename.outputs.package_filename }}
steps:
- name: Install Linux packages
run: sudo apt update && sudo apt install -y --no-install-recommends libgtk-3-0 libgtk-3-dev libpango-1.0-0 libpango1.0-dev libpangocairo-1.0-0

- name: Set up Go 1.20
uses: actions/setup-go@v2
uses: actions/setup-go@v4
with:
go-version: '1.20'
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Get Gtk version and the environment
run: |
pkg-config --modversion gtk+-3.0
env
- name: Caching build artifacts and modules
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
Expand All @@ -40,7 +43,7 @@ jobs:
id: build
run: |
make deps test build
echo "::set-output name=version_number::$(./hellocontest version)"
echo "version_number=$(./hellocontest version)" >> $GITHUB_OUTPUT
- name: Show Version
run: echo "Version ${{ steps.build.outputs.version_number }}"
Expand All @@ -55,10 +58,10 @@ jobs:
run: ./build-debpkg.sh ${{ steps.build.outputs.version_number }}

- id: package_filename
run: echo "::set-output name=package_filename::$(ls ./hellocontest*.deb | head -n 1)"
run: echo "package_filename=$(ls ./hellocontest*.deb | head -n 1)" >> $GITHUB_OUTPUT

- name: 'Upload package for linux_x86_64'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: hellocontest-package
path: ./hellocontest*.deb
Expand Down

0 comments on commit 527cf3d

Please sign in to comment.