diff --git a/lib/as3/gradle/publishing.gradle b/lib/as3/gradle/publishing.gradle
new file mode 100644
index 0000000..3e0ecf3
--- /dev/null
+++ b/lib/as3/gradle/publishing.gradle
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+// Following Gradle best practices to keep build logic organized
+
+model {
+    tasks.signMavenPublication {
+        dependsOn compileFlex
+    }
+}
+
+publishing {
+    publications {
+        maven(MavenPublication) {
+
+            groupId = "$group"
+            artifactId = "${project.name}"
+            version = "$version"
+
+            def swcFile = file("$buildDir/libthrift-as3.swc")
+            artifact(swcFile)
+
+            pom {
+                description = 'Thrift is a software framework for scalable cross-language services development.'
+                packaging = 'swc'
+
+                // older gradle doesn't recognize all the properties, so we inject them..
+                withXml {
+                    asNode().with {
+                        appendNode('name', 'Apache Thrift')
+                        appendNode('url', 'http://thrift.apache.org/')
+                        appendNode('scm').with {
+                            appendNode('url', 'https://github.com/apache/thrift/')
+                            appendNode('connection', 'scm:git:https://github.com/apache/thrift.git')
+                            appendNode('developerConnection', 'scm:git:git@github.com:apache/thrift.git')
+                        }
+                        appendNode('issueManagement').with {
+                            appendNode('url', 'https://issues.apache.org/jira/projects/THRIFT/')
+                            appendNode('system', 'Jira')
+                        }
+                        appendNode('licenses').with {
+                            appendNode('license').with {
+                                appendNode('name', 'The Apache Software License, Version 2.0')
+                                appendNode('url', "${project.license}")
+                            }
+                        }
+                        appendNode('organization').with {
+                            appendNode('name', 'The Apache Software Foundation')
+                            appendNode('url', 'http://www.apache.org/')
+                        }
+                        appendNode('developers').with {
+                            appendNode('developer').with {
+                                appendNode('id', 'dev')
+                                appendNode('name', 'Apache Thrift Developers')
+                                appendNode('email', 'dev@thrift.apache.org')
+                            }
+                        }
+                    }
+                }
+            }
+        }
+    }
+    repositories {
+        maven {
+            url = property('maven-repository-url')
+
+            if (project.hasProperty('mavenUser') && project.hasProperty('mavenPassword')) {
+                credentials {
+                    username = property('mavenUser')
+                    password = property('mavenPassword')
+                }
+            }
+        }
+    }
+}
+
+signing {
+    required { property('sign') }
+    sign publishing.publications.maven
+}
