Skip to content

Commit adf9192

Browse files
author
Roberto Sora
authored
[skip changelog] Github Actions bugfixes (#646)
* Replace $PWD with github actions workspace variable to solve invalid chars issue in container volume binding * Remove Tag step adding tag parse directly in notarization step * Add semver tool to enable pre-release flag in release creation
1 parent e556625 commit adf9192

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

Diff for: .github/workflows/nightly.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
image: arduino/arduino-cli:builder-1
1414
volumes:
1515
# cache go dependencies across pipeline's steps
16-
- $PWD/go:/go
16+
- ${{ github.workspace }}/go:/go
1717

1818
steps:
1919
- name: checkout

Diff for: .github/workflows/release.yaml

+13-8
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
image: arduino/arduino-cli:builder-1
1515
volumes:
1616
# cache go dependencies across pipeline's steps
17-
- $PWD/go:/go
17+
- ${{ github.workspace }}/go:/go
1818

1919
steps:
2020
- name: Checkout
@@ -42,10 +42,6 @@ jobs:
4242
with:
4343
name: dist
4444

45-
- name: Get the current release tag
46-
id: get_tag
47-
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
48-
4945
- name: Download Gon
5046
run: |
5147
wget -q https://github.com/mitchellh/gon/releases/download/v0.2.2/gon_0.2.2_macos.zip
@@ -54,7 +50,6 @@ jobs:
5450
5551
- name: Notarize binary, re-package it and update checksum
5652
env:
57-
TAG: ${{ steps.get_tag.outputs.VERSION }}
5853
AC_USERNAME: ${{ secrets.AC_USERNAME }}
5954
AC_PASSWORD: ${{ secrets.AC_PASSWORD }}
6055
# This step performs the following:
@@ -70,7 +65,8 @@ jobs:
7065
gon gon.config.hcl
7166
# GitHub's upload/download-artifact@v1 actions don't preserve file permissions,
7267
# so we need to add execution permission back until @v2 actions are released.
73-
chmod +x dist/arduino_cli_osx_darwin_amd64/arduino-cli
68+
chmod +x dist/arduino_cli_osx_darwin_amd64/arduino-cli
69+
TAG=${GITHUB_REF/refs\/tags\//}
7470
tar -czvf dist/arduino-cli_${TAG}_macOS_64bit.tar.gz \
7571
-C dist/arduino_cli_osx_darwin_amd64/ arduino-cli \
7672
-C ../../ LICENSE.txt
@@ -106,6 +102,15 @@ jobs:
106102
echo $body
107103
echo "::set-output name=BODY::$body"
108104
105+
- name: Identify Prerelease
106+
# This is a workaround while waiting for create-release action
107+
# to implement auto pre-release based on tag
108+
id: prerelease
109+
run: |
110+
wget -q -P /tmp https://github.com/fsaintjacques/semver-tool/archive/3.0.0.zip
111+
unzip -p /tmp/3.0.0.zip semver-tool-3.0.0/src/semver >/tmp/semver && chmod +x /tmp/semver
112+
if [[ $(/tmp/semver get prerel ${GITHUB_REF/refs\/tags\//}) ]]; then echo "::set-output name=IS_PRE::true"; fi
113+
109114
- name: Create Github Release
110115
id: create_release
111116
uses: actions/create-release@master
@@ -116,7 +121,7 @@ jobs:
116121
release_name: ${{ github.ref }}
117122
body: ${{ steps.changelog.outputs.BODY }}
118123
draft: false
119-
prerelease: false
124+
prerelease: ${{ steps.prerelease.outputs.IS_PRE }}
120125

121126
- name: Upload release files on Github
122127
uses: svenstaro/upload-release-action@v1-release

0 commit comments

Comments
 (0)