Merge pull request #59 from Backblaze/fix-bucket-with-file-lock #19
Workflow file for this run
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: Continuous Delivery | |
on: | |
push: | |
tags: 'v*' # push events to matching v*, i.e. v1.0, v20.15.10 | |
env: | |
PYTHON_DEFAULT_VERSION: '3.9' | |
GO_DEFAULT_VERSION: '1.20' | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
jobs: | |
build-linux-pybindings: | |
runs-on: ubuntu-latest | |
container: | |
image: python:3.9 # can not use ${{ env.PYTHON_DEFAULT_VERSION }} here | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
outputs: | |
version: ${{ steps.build.outputs.version }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install dependencies | |
working-directory: python-bindings | |
run: | | |
apt-get -y update | |
apt-get -y install patchelf | |
make deps | |
- name: Build python bindings | |
id: build | |
working-directory: python-bindings | |
run: | | |
make build | |
- name: Upload python bindings | |
uses: actions/upload-artifact@v2 | |
with: | |
name: py-terraform-provider-b2-linux | |
path: python-bindings/dist/py-terraform-provider-b2 | |
if-no-files-found: error | |
retention-days: 1 | |
build-macos-pybindings: | |
runs-on: macos-11 | |
outputs: | |
version: ${{ steps.build.outputs.version }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ env.PYTHON_DEFAULT_VERSION }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ env.PYTHON_DEFAULT_VERSION }} | |
- name: Install dependencies | |
working-directory: python-bindings | |
run: | | |
make deps | |
- name: Build python bindings | |
id: build | |
working-directory: python-bindings | |
run: | | |
make build | |
- name: Upload python bindings | |
uses: actions/upload-artifact@v2 | |
with: | |
name: py-terraform-provider-b2-darwin | |
path: python-bindings/dist/py-terraform-provider-b2 | |
if-no-files-found: error | |
retention-days: 1 | |
build-and-deploy: | |
needs: [build-linux-pybindings, build-macos-pybindings] | |
env: | |
NOPYBINDINGS: 1 # do not build python buildings | |
runs-on: ubuntu-latest | |
outputs: | |
upload_url: ${{ steps.create-release.outputs.upload_url }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go ${{ env.GO_DEFAULT_VERSION }} | |
uses: actions/[email protected] | |
with: | |
go-version: ${{ env.GO_DEFAULT_VERSION }} | |
- name: Install dependencies | |
run: | | |
make deps | |
- name: Download python bindings for all OSes | |
uses: actions/download-artifact@v2 | |
with: | |
path: python-bindings/dist/artifacts/ | |
- name: Postprocess python bindings | |
working-directory: python-bindings/dist | |
run: | | |
mv artifacts/py-terraform-provider-b2-linux/py-terraform-provider-b2 py-terraform-provider-b2-linux | |
mv artifacts/py-terraform-provider-b2-darwin/py-terraform-provider-b2 py-terraform-provider-b2-darwin | |
- name: Read the Changelog | |
id: read-changelog | |
uses: mindsers/changelog-reader-action@v2 | |
with: | |
version: ${{ needs.build-linux-pybindings.outputs.version }} | |
- name: Import GPG key | |
id: import_gpg | |
uses: paultyng/[email protected] | |
env: | |
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | |
PASSPHRASE: ${{ secrets.PASSPHRASE }} | |
- name: Create GitHub release | |
uses: goreleaser/goreleaser-action@v2 | |
with: | |
version: latest | |
args: release --rm-dist -p 1 | |
env: | |
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} | |
- name: Update GitHub release | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: v${{ needs.build-linux-pybindings.outputs.version }} | |
body: ${{ steps.read-changelog.outputs.changes }} | |
draft: false | |
prerelease: false |