Skip to content

Commit

Permalink
Fixes the release action
Browse files Browse the repository at this point in the history
  • Loading branch information
nkcr committed Jul 11, 2022
1 parent 063e8ee commit b2310d1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
15 changes: 3 additions & 12 deletions .github/workflows/go_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on:
types: [published]

jobs:
build:
name: build
release:
name: release
runs-on: ubuntu-latest

steps:
Expand All @@ -28,22 +28,13 @@ jobs:
# builds the binary and the .deb
run: make deb

release:
name: release
needs: build
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Publish release to aptly
env:
APTLY_USER: ${{ secrets.APTLY_USER }}
APTLY_PASSWORD: ${{ secrets.APTLY_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run: |
./deb-package/upload-artifacts.sh deb-package/dist/
./deb-package/upload-artifacts.sh deb-package/dist
- name: Update artifacts to Github's release
uses: softprops/action-gh-release@v1
Expand Down
7 changes: 5 additions & 2 deletions deb-package/upload-artifacts.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
#
# This script uploads .deb packages, creates a snapshot and publish a new
# version. It expects as input the folder containing the *.deb files.
Expand Down Expand Up @@ -32,12 +32,15 @@ gpg_passphrase="$GPG_PASSPHRASE" # will be passed over the network, use TLS !
aptly_api="https://aptly-api.dedis.ch"

gitversion=$(git describe --abbrev=0 --tags)
version=${gitversion:1}
version="${gitversion:1}"

aptly_repository=dvoting-release
aptly_snapshot=dvoting-$version
aptly_published=s3:apt.dedis.ch:/squeeze

echo "getting packages from $packages:"
ls $packages

echo "Check if snapshot $aptly_snapshot already exists"
res=$(curl -s -u $aptly_user:$aptly_password -o /dev/null -w "%{http_code}" ${aptly_api}/api/snapshots/$aptly_snapshot)

Expand Down

0 comments on commit b2310d1

Please sign in to comment.