From f5d3bd7c4e39ecb288d5bcc491d339cba4f0d1a9 Mon Sep 17 00:00:00 2001 From: Lincoln Wallace Date: Mon, 4 Dec 2023 19:46:11 -0300 Subject: [PATCH 1/6] add: github workflow automated build Add automated build on pull requests and commits on branch main. Signed-off-by: Lincoln Wallace --- .github/workflows/build-snap.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/build-snap.yml diff --git a/.github/workflows/build-snap.yml b/.github/workflows/build-snap.yml new file mode 100644 index 0000000..029f0f1 --- /dev/null +++ b/.github/workflows/build-snap.yml @@ -0,0 +1,20 @@ +name: Snap Builder +run-name: ${{ github.actor }} is building the ${{ github.repository }} +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: snapcore/action-build@v1 + id: build + - uses: actions/upload-artifact@v3 + with: + name: snap + path: ${{ steps.build.outputs.snap }} From c621d0a19332e1609ca0d1a1b835c9a149d8a949 Mon Sep 17 00:00:00 2001 From: Lincoln Wallace Date: Tue, 5 Dec 2023 08:21:18 -0300 Subject: [PATCH 2/6] refact: Requested improviments on PR for #IENG-869 Added separation lines and comentaries to improve redability Use output as snap name to don't leat hardcoded version or architecture. Signed-off-by: Lincoln Wallace --- .github/workflows/build-snap.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-snap.yml b/.github/workflows/build-snap.yml index 029f0f1..45be2dd 100644 --- a/.github/workflows/build-snap.yml +++ b/.github/workflows/build-snap.yml @@ -1,20 +1,27 @@ name: Snap Builder -run-name: ${{ github.actor }} is building the ${{ github.repository }} + on: push: branches: [ main ] pull_request: branches: [ main ] + # Allow manual trigger workflow_dispatch: jobs: build: runs-on: ubuntu-latest steps: + + # Checkout the code - uses: actions/checkout@v4 + + # Build the snap - uses: snapcore/action-build@v1 id: build + + # Upload builded artifact - uses: actions/upload-artifact@v3 with: - name: snap + name: ${{ steps.build.outputs.snap }} path: ${{ steps.build.outputs.snap }} From ee5ad71f64dca036edab530dfa9d160ad857b018 Mon Sep 17 00:00:00 2001 From: "Lincoln Wallace V. Almeida" Date: Tue, 5 Dec 2023 08:43:40 -0300 Subject: [PATCH 3/6] Update .github/workflows/build-snap.yml Verb tense corrections. Co-authored-by: Farshid Tavakolizadeh --- .github/workflows/build-snap.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-snap.yml b/.github/workflows/build-snap.yml index 45be2dd..a944bb2 100644 --- a/.github/workflows/build-snap.yml +++ b/.github/workflows/build-snap.yml @@ -20,7 +20,7 @@ jobs: - uses: snapcore/action-build@v1 id: build - # Upload builded artifact + # Upload the built artifact - uses: actions/upload-artifact@v3 with: name: ${{ steps.build.outputs.snap }} From e3c2f41ca18de57719b9ab59ebe4f2f1abcb9641 Mon Sep 17 00:00:00 2001 From: Lincoln Wallace Date: Tue, 5 Dec 2023 09:15:35 -0300 Subject: [PATCH 4/6] refact: add new line Signed-off-by: Lincoln Wallace --- .github/workflows/build-snap.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-snap.yml b/.github/workflows/build-snap.yml index a944bb2..9ef6285 100644 --- a/.github/workflows/build-snap.yml +++ b/.github/workflows/build-snap.yml @@ -25,3 +25,4 @@ jobs: with: name: ${{ steps.build.outputs.snap }} path: ${{ steps.build.outputs.snap }} + From c95fed25f923ed7fce2ccadff4fec4819e0a7e6c Mon Sep 17 00:00:00 2001 From: Lincoln Wallace Date: Wed, 6 Dec 2023 23:16:49 -0300 Subject: [PATCH 5/6] feat: Add name to jobs Adds name to workflow jobs to increase readability Signed-off-by: Lincoln Wallace --- .github/workflows/build-snap.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-snap.yml b/.github/workflows/build-snap.yml index 9ef6285..6a975c8 100644 --- a/.github/workflows/build-snap.yml +++ b/.github/workflows/build-snap.yml @@ -14,14 +14,17 @@ jobs: steps: # Checkout the code - - uses: actions/checkout@v4 + - name: Checkout code + uses: actions/checkout@v4 # Build the snap - - uses: snapcore/action-build@v1 + - name: Build snap + uses: snapcore/action-build@v1 id: build # Upload the built artifact - - uses: actions/upload-artifact@v3 + - name: Upload artifact + uses: actions/upload-artifact@v3 with: name: ${{ steps.build.outputs.snap }} path: ${{ steps.build.outputs.snap }} From a264746f9566d02a9031dd1e5727d3df20e147c9 Mon Sep 17 00:00:00 2001 From: Lincoln Wallace Date: Thu, 7 Dec 2023 17:05:35 -0300 Subject: [PATCH 6/6] Refact: Remove comments that are no longer necessary Now that the Jobs have a name, it can be used to self describe what the jobs does So the commentaries are no longger need. Signed-off-by: Lincoln Wallace --- .github/workflows/build-snap.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build-snap.yml b/.github/workflows/build-snap.yml index 6a975c8..b383201 100644 --- a/.github/workflows/build-snap.yml +++ b/.github/workflows/build-snap.yml @@ -13,16 +13,13 @@ jobs: runs-on: ubuntu-latest steps: - # Checkout the code - name: Checkout code uses: actions/checkout@v4 - # Build the snap - name: Build snap uses: snapcore/action-build@v1 id: build - # Upload the built artifact - name: Upload artifact uses: actions/upload-artifact@v3 with: